acExport - Run time error

JH40

Registered User.
Local time
Today, 13:44
Joined
Sep 16, 2010
Messages
100
Hi all, I upgraded from Access 2003 to 2010 (ugh!) and now am experiencing several issues from the conversion. I won't plague you with all of them, except this one... Here is my previous VB:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryABC", "T:\ACOCandS\_Structure\Analytics\DATA Acquisition\All ADT\NMHAll\DailyERTemplateAllNonMH.xls"

Here is the code I updated to with the conversion:
DoCmd.TransferSpreadsheet acExport, 10, "QryABC", "T:\ACOCandS\_Structure\Analytics\DATA Acquisition\All ADT\NMHAll\DailyERTemplateAllNonMH.xlsx", True, ERDataLoad

When I converted, I had to define a named range to get the export to work at all. When I run the code, the export deletes the headers on the template while generating "run time error 3434 cannot expand named range". When I open the excel template, put the headers back in, save it and leave it open, then run the code again. The export works. I have also tried this with the acSpreadsheetTypeExcel9--same issue. ???? Stumped here...
 
Hi.. I notice a 10 in the command.. That is offsetting the parameters.. Maybe that is why you are getting the error.. try..

DoCmd.TransferSpreadsheet acExport, "QryABC", "T:\ACOCandS\_Structure\Analytics\DATA Acquisition\All ADT\NMHAll\DailyERTemplateAllNonMH.xlsx", True, ERDataLoad
 

Users who are viewing this thread

Back
Top Bottom