Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2006

Tip: Looking for answers? Try searching our database.

TransferSpreadSheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rafi - 25 Feb 2006 21:56 GMT
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,"QryExportPriority", "C:\Documents and Settings\595930\Desktop\STI Reports\Export.xls",)
End Sub
tina - 25 Feb 2006 22:03 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.