remove the comma at the end of the arguments, directly in front of the
closing parenthesis.
hth
> Trying to export a query to excel and am getting an error (Compile Error:
> Expected Expression). Can anyone pinpoint the problem
>
> Private Sub CmdRunExcel_Click()
DoCmd.TransferSpreadsheet(acExport,acSpreadsheetTypeExcel9,"QryExportPriorit
y", "C:\Documents and Settings\595930\Desktop\STI Reports\Export.xls",)
> End Sub
Rafi - 26 Feb 2006 01:33 GMT
Tina - Thanks for your help. I removed the comma, carelessness, and now the
error message is "Compile error: Expected: = ; I have no idea where the equal
sign (=) fits in.
Thnaks
> remove the comma at the end of the arguments, directly in front of the
> closing parenthesis.
[quoted text clipped - 9 lines]
> y", "C:\Documents and Settings\595930\Desktop\STI Reports\Export.xls",)
> > End Sub
Ken Snell (MVP) - 26 Feb 2006 01:55 GMT
You don't need the parentheses at all:
DoCmd.TransferSpreadsheet
acExport,acSpreadsheetTypeExcel9,"QryExportPriority", "C:\Documents and
Settings\595930\Desktop\STI Reports\Export.xls"

Signature
Ken Snell
<MS ACCESS MVP>
> Tina - Thanks for your help. I removed the comma, carelessness, and now
> the
[quoted text clipped - 18 lines]
>> y", "C:\Documents and Settings\595930\Desktop\STI Reports\Export.xls",)
>> > End Sub
Rafi - 26 Feb 2006 02:52 GMT
Works like a charm!!!!!!! Thanks
> You don't need the parentheses at all:
>
[quoted text clipped - 24 lines]
> >> y", "C:\Documents and Settings\595930\Desktop\STI Reports\Export.xls",)
> >> > End Sub