SSIS to Excel 2007 Export Issues
Ever tried to export to Excel 2007 from SSIS and experienced issues with the output file then this blog entry may help. The default Microsoft Excel 2007 file fomat, with the file extension .xslx (a Zip file that contains multiple XML files). However Excel can also be saved to a binary format, with the file extension .xlsb. Excel supported file formats.
The SQL Server Books Online topic, How to: Connect to an Excel Workbook, contains incomplete but potentially misleading information when instructing one to set Extended Properties = "Excel 12.0" on the OLE DB Connection Manager.
- Importing. The driver doesn’t care which of the 2 values (listed below) you use for Extended Properties when you are importing from Excel 2007. The driver infers the proper Excel file format from the existing input file.
- Exporting. When you are exporting to Excel 2007, however, Extended Properties = "Excel 12.0" creates an Excel binary file. This would normally not be an issue however if you gave your file the standard l .xslx file extension, the Excel application later complains that the file format is incorrect (because it’s really .xlsb) and refuses to open the file.
To correct this simply use the property settings outlined below:
- Default file extension of .xslx (Excel XML format), and Extended Properties = "Excel 12.0 Xml"
- Non-default file extension of .xslb (Excel binary format), and Extended Properties = "Excel 12.0"