0

I have as SSIS package which calls a macro on multiple Excel files one by one. Although this package runs correctly from BIDS as well as from SQL Server stored packages - > Run Package option. But it fails with below exception when executed as a step in a SQL Server Agent Job.

Exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Cannot create ActiveX component. at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
at ST_4fc395700019420780960cffb1260896.vbproj.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()

1 Answer 1

0

Might be useful to look at this entry where giving NETWORK SERVICE access to the DCOM Config -> Microsoft Excel Application resolves the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Could you please tell me why this issue is occuring only when I run SSIS package calling excel macro as an SSIS Job step?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.