VBA to run menu selection "Analyze It with Microsoft Excel"

  • Thread starter Thread starter Clint Marshall
  • Start date Start date
C

Clint Marshall

I have a query that I need to export to Excel.
- When I select the query output, copy it and paste it into a blank Excel
spreadsheet, the formatting is preserved (such as currency format), but all
columns are set to the standard width and have to be re-sized.
- When I programmatically export to Excel using DoCmd.TransferSpreadsheet,
the formatting is lost and the columns are set to the standard width,
leaving lots of reformatting to do.
- When I use the menu selection "Tools..Office Links..Analyze it with
Microsoft Excel", formatting is preserved and the column widths are correct.
Excel is open and I'm ready to go!

I'd like to create a button with code that will let me either run the menu
selection "Tools..Office Links..Analyze it with Microsoft Excel" or perform
an equivalent operation.
How do I program this?

Thank you!

-Clint Marshall
 
Try using DoCmd.OutputTo instead. I've always found it kinder to formatting
than TransferSpreadsheet.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top