I'm using "DoCmd.RunCommand acCmdOutputToExcel" to export query results from a form to Excel. The data exports, but each time, the user gets the following error message when Excel attempts to automatically open the file, "We found a problem with some content in "myform.xlsx. Do you want us to try to recover as much as we can? If you trust the source of the workbook, click Yes."
After clicking yes, the workbook opens with the data, but still get another message indicating what "repairs" were made: "Repaired Records: Format from /xl/styles.xml part (Styles).
after pressing close, everything is fine (except that the values in the date column are not in the right format).
What additional coding could I include to prevent these messages from popping up for each user (as well as getting the dates to be in the correct format)?
I presume I could use, "DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12" or "DoCmd.OutputTo acOutputReport", but then I would need to specify a location for the file to be saved (and they only seem to save in .xls format rather than .xlsx), and I'd rather avoid that (unless this is the most efficient method).
thanks!
After clicking yes, the workbook opens with the data, but still get another message indicating what "repairs" were made: "Repaired Records: Format from /xl/styles.xml part (Styles).
after pressing close, everything is fine (except that the values in the date column are not in the right format).
What additional coding could I include to prevent these messages from popping up for each user (as well as getting the dates to be in the correct format)?
I presume I could use, "DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12" or "DoCmd.OutputTo acOutputReport", but then I would need to specify a location for the file to be saved (and they only seem to save in .xls format rather than .xlsx), and I'd rather avoid that (unless this is the most efficient method).
thanks!