Compile error when exporting to Excel

LB79

Registered User.
Local time
Today, 04:29
Joined
Oct 26, 2007
Messages
505
Hello,

Im a bit confused with a debug im getting. The code im running is very simple and works in my 2003 database (Im transferring to 2007).

Below is the code. The Path and FileName are both being read correctly. FOr some reason its giving a compile error variable not defined. Its highlighting the table i want to export (the table does exist and ive checked name/spelling). Does anyone know what could be wrong?

Thanks

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, tbl_MyTable, Path & FileName
 
The table is a string not a variable. Put it in double quotes.
 
Fantastic - Thanks!
 

Users who are viewing this thread

Back
Top Bottom