Create an Excel spreadsheet (1 Viewer)

projecttoday

Registered User.
Local time
Today, 08:37
Joined
Jan 5, 2011
Messages
51
I want to create an Excel spreadsheet from Access. It's just a dump of some data from a table. Can I do this using either Doocmd.transferspreadsheet or Docmd.Outputto without specifying a file path and without having a save as dialog box popping up? Currently I'm using Excel object code to do this and I thought it would be better to using a single statement if that's possible. Could be something obvious. But no file path and no save as dialog box.
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 08:37
Joined
Dec 26, 2002
Messages
4,751
I want to create an Excel spreadsheet from Access. It's just a dump of some data from a table. Can I do this using either Doocmd.transferspreadsheet or Docmd.Outputto without specifying a file path and without having a save as dialog box popping up? Currently I'm using Excel object code to do this and I thought it would be better to using a single statement if that's possible. Could be something obvious. But no file path and no save as dialog box.

How can you create a spreadsheet without putting it someplace? I guess I don't understand your question.

If you mean, you just want Excel to be opened and the data dumped, then I'm not sure of a better way than what you are already doing. Where's the harm in just pushing it to a temporary location and having Access open the spreadsheet? Might be a lot faster and only take a few lines of code.
 

ghudson

Registered User.
Local time
Today, 08:37
Joined
Jun 8, 2002
Messages
6,195
You can output a query or table to an excel file and allow the user to define the name and location. But as Vassago mentioned, it is best to define the location and name so that you can control the outcome of the output.

Code:
DoCmd.OutputTo acOutputQuery, "YourQueryNameHere", "MicrosoftExcelBiff8(*.xls)", "", True, "", 0
 

Users who are viewing this thread

Top Bottom