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?

Who is Participating?
Gustav BrockConnect With a Mentor CIOCommented:
You have to use acSpreadsheetTypeExcel12Xml for this filename.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.