Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting to Excel from VBA

Status
Not open for further replies.

Maquis

Programmer
Jul 19, 2001
934
US
Hi there. I'm hoping someone can help me with this code. I'm sure there is a very simple way to do this, but I have not been able to find the code on my own.

I am trying set up a command button for a user to export a table (query actually). Two files need to be exported, a comma delimited text file and also an Excel file with the same format. I've coded the text file using a simple transfertext statement, but I'm stumped on the Excel export. :-I

I know how to do this by using the menus, but the menus will not be available to the users in this database.


 
Ack, never mind. I just found the transferspreadsheet command. Geez, I feel stupid.
 
hi,

look under "help" in access "export excel" use the transferspreadsheet method

docmd.TransferSpreadsheet _ acExport,acSpreadsheetTypeExcel9, ...

grtz

CPU-burn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top