Reputation: 8959
I'm getting the following error when I try to run a macro that eventually uses the DoCmd.TransferText
function. Here is the error below:
Cannot find object. Make sure the object exists and you spell its name and path correctly
I've used this method before to create a text file and add contents to it either from a table or a query. Can someone correct me on this but doesn't the Transfer Text method create the file if it doesn't already exist?
Here is the code where i call it:
'Create Dispense File
DoCmd.TransferText acExportDelim, "DispenseExportSpec", "qryExport", DispenseFileName
Call Sleep(5000)
DoCmd.TransferText acExportDelim, "ExportDispenseCFSpec", "qryExportDispenseCF", ExportDispenseCFName
Call Sleep(5000)
(It fails on the first) This can't/shouldn't be a permissions issue as I have full read/write/edit abilities over the folder and its subfolders; it's not a path issue as I've verified multiple times, so what is the the problem here?
Access Version: MS Access 2003
Thanks
Upvotes: 1
Views: 203
Reputation: 1212
Try removing the spec argument and let it use the default? The documentation on that seems wonky. Just do a DoCmd.TransferText acExportDelim, , "qryExport", DispenseFileName
Upvotes: 2