Creating excel file through SSIS package throwing COM Exception error
-
Tuesday, February 12, 2013 7:56 PM
I am using SSIS component under SQLSERVER BI TOOLS
I have created an script task for creating excel file & then loading the data into excel file. Also i have reffered the dlls required for creating excel file i.e..Microsoft.Office.Interop.Excel. In this machine i don't have an MS Office installation setup. while executing this script task it is throwing below error
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.
at ST_1568e3454381415cba6bcc0ad3ae38b0.csproj.ScriptMain.PrintToExcel(DataSet ds_PrintToExcel)
at ST_1568e3454381415cba6bcc0ad3ae38b0.csproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
All Replies
-
Tuesday, February 12, 2013 8:00 PMModerator
- Proposed As Answer by SSISJoostMicrosoft Community Contributor, Moderator Wednesday, February 13, 2013 8:09 AM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 2:29 AM
-
Wednesday, February 13, 2013 6:30 AM
Hi Rajesh,
Unfortunatelly you can't just simple use Excel Destination, because it requires Drivers.
Here is some notes:
1. Driver microsoft.ace.oledb.12.0 (32 bit) must be installed
2. SSIS installed on 64bit station can work only with 32bit drivers
It means that Office 64x must be replaced by Office 32x
- Proposed As Answer by SSISJoostMicrosoft Community Contributor, Moderator Wednesday, February 13, 2013 8:09 AM
- Unproposed As Answer by SSISJoostMicrosoft Community Contributor, Moderator Wednesday, February 13, 2013 8:09 AM
-
Wednesday, February 13, 2013 6:34 AM
More information about "Excel Driver" you can find here:
http://dougbert.com/blog/post/excel-in-integration-services-part-1-of-3-connections-and-components.aspx
-
Wednesday, February 13, 2013 7:03 AM
Hi Rajesh,
Check whether you are able to call Excel Driver from your package while creating the connection for Excel, Then check for 32 bit or 64 bit and then try to run the package.
Regards
Naveen
-
Wednesday, February 13, 2013 8:01 AMModerator
Without office you can't use excel interop in a Script Task. It's probably the easiest to use a Excel Destination like Arthur mentioned! Only it doesn't create an excel. So the workaround for that is to create an excel file that you use as template.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 2:29 AM


