Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

docmd.transferspreadsheet acexport causing error

Status
Not open for further replies.

monicah

Programmer
Feb 21, 2002
2
US
My user is receiving the following error when trying to run this code using an mde file. The user does have access installed.

The Microsoft Jet database engine cound not find the object ''. Make sure the object exists and that you spell its name and the path correctly.

I've checked references and they are correct. I then opened the actual mdb and ran the code and received the same error. This is how I found what was actully causing the error. I changed the code from this:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblHRA401Final", "c:\temp\HRA401.XLS", True
To this:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "tblHRA401Final", "c:\temp\HRA401.XLS", True

I then tested it using the mdb and it worked without any errors. I made a new mde file and then had the user try it and she is still receiving the error. I'm not sure where to go next. Any suggestions would be appreciated.
 
does the user have rights to this folder? can they manually save an excel file to this dir?

It's not what you know. It's who's on Tek-Tip's
 
Ends up the module that had this code in it apparently was corrupt. I copied all of the code into notepad, saved the module, compiled the database. Then copied the code back into the module. Deleted the line of code "docmd.transferspreadsheet". Saved the module. Recompiled. Then I retyped "docmd.transferspreadsheet" and saved, recompiled and then it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top