Error with Excel Application Scope from an invoke

Hello!

I’m working with an excel file inside a .xaml. The problem appears when I execute my main code, with an invoke of that .xaml. This is the error thrown:

Source: Excel Application Scope - Jerarquia

Message: Error opening workbook. Make sure Excel is installed.

Exception Type: System.Exception

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Exception: Error opening workbook. Make sure Excel is installed. ----> System.Runtime.InteropServices.COMException: Creating an instance of the COM component with CLSID {00024500-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001 La llamada fue rechazada por el destinatario. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at UiPath.Excel.WorkbookApplication.StartNewApplication()
— End of inner ExceptionDetail stack trace —
at UiPath.Executor.WorkflowRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

The strange thing is that when I test the .xaml file directly (no invoke) there is no error. Arguments are ok, excel file name is ok… Don’t know how to fix it…

thank you!

Hi @ajg,

If you are going to use excel application scope activity in your machine excel application must installed. If not use workbook activity to get the data or write the data using below activity
1.Read Range
2. Write range

Regards,
Arivu :slight_smile:

Excel application is already installed. I don’t understand why the problem appears only when I call the .xaml from an invoke activity.

Hi @ajg

Could you post a sample or a few screenshots? It is quite interesting.

From what you are saying is that you have an xaml file with an Excel Application Scope that you invoke using the Invoke Workflow File activity and that it then throws you this error that you’ve posted?

I would really, really want to see the sample zipped project.

Please also let us know about:

  • your Studio version
  • your packages versions (screenshot of the Package Manager)
  • your Office version

Hi @ajg

Hopefully the issue got resolved for you, if yes, please share the details here that can help others.

One of the probable cause I can think of and encountered was that the sheet had macro and the setting was not enabled.

Hope this may help someone.

Regards
Rajat