The Current Setup:
So, I can use the following code to save a file as an XLS:
I can also use the following code to save a file as an XLSX (Since I use Office 2010):
I have tried (unsuccessfully) to save the file as an XLSX using the following code:
Why does this not work? Last I checked, Excel 12 was Excel 2007 (a version that supports XLSX). Am I missing something?
(For those interested, I get a
This extension can not be used with the selected file type error)
XlFileFormat.xlExcel12 is Excel 12.0 binary format (
xlsb) , for OpenXML (i.e.
xlsx) you need to use
XlFileFormat.xlOpenXMLWorkbook enum value.
For a complete reference see here.