I am using the following code to export a query from Microsoft Access 2013
myfilename = "W:\AD_Reports\AnotherTest.xlsx"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryalltimerecordsbydate", myfilename
Everything seems to work but when i try to open the file it gives a message Format or File Extension not valid. I deleted the file and did it over and it still produces the same error. Thanks for any help.