I have code to save a data table to an Excel file using the _Workbook.SaveAs method. When I open the resulting file it says the file type doesn't match and the name displayed at the top of the excel window instead of being the file name, just says Book1.xlsx.
The arguments of the method I'm using are
xlWorkBook.SaveAs(File, Excel.XlFileFormat.xlWorkbookDefault, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
Am I missing a setting so when I try to open the file, it automatically recognizes the file as the correct format?