TransferSpreadsheet .xlsx files

aziz rasul

Active member
Local time
Today, 09:49
Joined
Jun 26, 2000
Messages
1,935
Why does the following code work for .XLS files but not for .XLSX files?

Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strQueryName, Me.txtOutputPath & strReportName & ".XLSX"

If I use acSpreadsheetTypeExcel12 the problem persists. When I open the .XLSX file I get the error

Excel cannot open the file "Report.xlsx" because the file format or extension is not valid. Verify that the file has not been corrupted and ...

I'm using Access 2010.
 
Change this: acSpreadsheetTypeExcel9 (this is for an .xls format only version 2000-2003)

To this: 10
 
Thanks Alan, that did the trick.
 

Users who are viewing this thread

Back
Top Bottom