I'm having a problem with some data I'm trying to export to Excel 2010. I'm allowing the user to use either the .xls or .xlsx extension. My code looks like this:
DoCmd.TransferSpreadsheet acExport, IIf(Right(txtExportPathAndFileName, 5) = ".xlsx", acSpreadsheetTypeExcel12Xml, acSpreadsheetTypeExcel12), "qryTherapistsCaseloads4Excel", txtExportPathAndFileName, True
When I try to open the exported .xlsx, I get a message that the extension or file type is invalid.