Run time error '3011' exporting to excel

garethdavies

New member
Local time
Today, 16:16
Joined
May 14, 2015
Messages
1
I'm attempting to export some table queries to excel using the code I have posted below as a module.

I am getting an error saying it cannot find my query.

I have used this code to do the above on 2 queries within the same table and it works fine. I don't understand why it would not work for a different query.

Any help would be greatly appreciated.

Option Compare Database
Private Sub exportQueryToExcel()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CUSTOMER FOCUS", "C:\Users\gareth.davies1\Desktop\Training\SHAREPOINT FEED MASTER.XLSM", True
End Sub
 
Hi,
Are you sure there is no typo in the query name: "CUSTOMER FOCUS"?
 
...also what is the full error message?

Welcome to the forum as well garethdavies :)
 

Users who are viewing this thread

Back
Top Bottom