TransferSpreadsheet

roberemok

Registered User.
Local time
Today, 03:13
Joined
Jun 21, 2004
Messages
20
Can anybody help me with this action? I'm trying to export a query to Excel and I'm wondering if this would do this.
 
Option 1: Use the following code

Code:
Sub export_to_excel()
Dim mfile
myfile = "Your path name/spreadsheet name.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "your query name", myfile
End Sub()()

Option 2

Use the Transferspreadsheet action in a macro - Although I think this option only allows you to export from a table not a query. I always use option 1.

HTH
Hay
 
Hayley Baxter said:
Option 1: Use the following code

Code:
Sub export_to_excel()
Dim mfile
myfile = "Your path name/spreadsheet name.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "your query name", myfile
End Sub()()

hi. sorry, i am just a newbie here. where should the code be placed? because i am currently experiencing the same problem. thanks.
 

Users who are viewing this thread

Back
Top Bottom