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

garethdavies

New member
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
Joined
Jan 19, 2010
Messages
400
Hi,
Are you sure there is no typo in the query name: "CUSTOMER FOCUS"?
 

vbaInet

AWF VIP
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 (Users: 0, Guests: 1)

Top Bottom