Run time error '3011' exporting to excel (1 Viewer)

garethdavies

New member
Local time
Today, 06:21
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
 

marlan

Registered User.
Local time
Today, 08:21
Joined
Jan 19, 2010
Messages
409
Hi,
Are you sure there is no typo in the query name: "CUSTOMER FOCUS"?
 

vbaInet

AWF VIP
Local time
Today, 06:21
Joined
Jan 22, 2010
Messages
26,374
...also what is the full error message?

Welcome to the forum as well garethdavies :)
 

Users who are viewing this thread

Top Bottom