Import from a macro-enabled Excel 2007 workbook (*.xlsm) (CORRECTED)

31. March 2009 07:35 by Dougbert in   //  Tags:   //   Comments (3)

CORRECTED ON 4/2/09 FROM ORIGINAL POSTING ON 3/31/09

The Office 12 ACE Provider recognizes the .XLSM extension for a macro-enabled Excel 2007 workbook.

However, the Excel Connection Manager (in SQL Server 2008 Integration Services) only recognizes the .XLSX file extension for Excel 2007 files. Therefore you have to use the OLE DB Connection Manager (and Source and Destination) with Excel 2007 files that have a file type and file extension other than .XLSX.

Importing. You can connect to, and import from, a macro-enabled Excel 2007 workbook (*.xlsm). You do not have to change the file extension temporarily to *.xlsx, which is what the original version of this posting suggested.

Exporting. However, the Provider does not fully support exporting to the .XLSM format, since it would not make sense for the provider to be writing out Visual Basic code, as implied by "macro-enabled". I was not able to export successfully to an existing .XLSM workbook in a quick test using the SQL Server Import and Export Wizard.

-Doug

 

Comments (3) -

Todd McDermid
5/6/2009 3:05:46 AM #

Doug - my Excel Connection Manager (in 2008) rejects use of non-XLS/XLSX filenames.  (This is the Connection String: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Sauder Projects\dev\net\Test SSIS\Test.xlsx;Extended Properties="EXCEL 12.0;HDR=YES";)


Am I using the wrong provider?


Todd McDermid
5/6/2009 3:08:00 AM #

Doug - more info that I can find: on Connect - connect.microsoft.com/.../ViewFeedback.aspx">connect.microsoft.com/.../ViewFeedback.aspx


Tell us they're wrong!


dougbert
5/10/2009 3:54:29 AM #

Todd,


The Excel connection manager only recognizes the .XLSX file extension for Excel 2007 files, you're right. You have to use the OLE DB connection manager, source, and destination for Excel 2007 files with other extensions. I've added this above to the text of the blog post.


The number of votes on Connect issues may affect what gets fixed and what doesn't, as I mentioned in another blog post. Readers who want to work more conveniently with Excel in SSIS, take note.


-Doug


Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading