export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello I am using this VBA comand to attempt to copy an
access table to excel. It contiuously gives me an error
that it cannot find the Object. The object I am trying
to export is an access table, which is called "Credit
Table" and I am using the Form to allow the user to
choose
which table to export (the reason for the Forms!Ins!CQ
section)

do I need to add something to specify that it is a table
I
am exporting.

DoCmd.TransferSpreadsheet acExport, , _
Forms!Ins!CQ & " Table", "C:\Actual \Trend.xls"
 
Because your table name contains a space, you may need to add square
brackets:

Dim strTableName As String

strTableName = "[" & Forms!Ins!CQ & " Table]"
DoCmd.TransferSpreadsheet acExport, , _
strTableName, "C:\Actual \Trend.xls"

The folder name ending in a space also looks wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

export 1
Run Time Error 3011 1
VBA code issue...Would love expert help. 5
Exporting to Excel 1
My Folder 4
Export from a form 2
Export to Excel Problem for One User 4
TransferSpreadsheet with Criteria 3

Back
Top