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()

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Nisha
  • 1

1 Answers1

0

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

Community
  • 1
  • 1
Janis S.
  • 2,526
  • 22
  • 32
  • Could you please tell me why this issue is occuring only when I run SSIS package calling excel macro as an SSIS Job step? – Nisha May 16 '17 at 05:51