Ms Access docmd.transferspreadsheet

kenabbott
kenabbott used Ask the Experts™
on
Hi

I am trying to use transfer spreadsheet to transfer data from a table into a spreadsheet (I am using A2010 and Excel 2010).  The file transfers successfully but when I try to open it I get a message saying the extension doesn't match the file.  I am assuming the problem is with the Transfer Type that I am using - what is the correct syntax to transfer to an Excel 2010 spreadsheet?

Many thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
try this command line

docmd.transferspreadsheet acexport,acSpreadsheetTypeExcel12Xml, "tableName","c:\folderName\myexcel.xlsx",true

or this

docmd.transferspreadsheet acexport,10, "tableName","c:\folderName\myexcel.xlsx",true

Author

Commented:
Many thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial