When i use the following instruction
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, stDocName, fn, True, ""
with fn = filename.xlsx then filename.xlsx is built up.
When i try to open filename.xlsx then i get an error :
Excel cannot open the file "filename.xlsx" because the file format or file extension is not valid.
What i'm doing wrong?