excel - Unable to open .xlsx file exported from Access 2010 using DoCmd.TransferSpreadsheet -


i'm having problems vba code exports table ms access 2010 excel 2010 format using docmd.transferspreadsheet command. code runs without error in access , file created. however, when try open file in excel 2010 receive following error message: excel cannot open file 'xxxxx.xlsx' because file format or file extension not valid. verify file has not been corrupted , file extension matches format of file. here code use setup , execute export:

exportfilename = "\\network1\share$\filename_" & ".xlsx" docmd.transferspreadsheet acexport, acspreadsheettypeexcel12, "tablename", exportfilename, true 

i looked @ number of possible solutions before posting, have tried

  • replacing acspreadsheettypeexcel12 acspreadsheettypeexcel12xml
  • replacing acspreadsheettypeexcel12 integer 10 or 9
  • ensuring had full access/permissions directory saving file
  • opening file file -> open dialog rather double-clicking file
  • saving file local location, i.e. "c:\users\paul\documents\"

none of these solved problem.

the 1 solution found follows:

exportfilename = "\\network1\share$\filename_" & ".xls" docmd.transferspreadsheet acexport, acspreadsheettypeexcel9, "tablename", exportfilename, true 

where extension .xls , spreadsheet type acspreadsheettypeexcel8. can work now, appreciate other possible suggestions.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -