I have an SSIS package
that has a script task, that reads from an Excel
.
I am getting the below errors and can't seem to find the issue.
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 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()
I have narrowed the issue down to these 2 lines, where I am setting the Excel
application.
Excel.Application xlApp;
xlApp = new Excel.ApplicationClass();
It's the setting of the value of xlApp
that seems to be causing the error.
I am using Visual Studio 2017.
Can anyone help me out on this?