Exception from HRESULT: 0x800401A8


#1

Hi everyone, does anyone perhaps know this error?
I would really like to know how to solve it, because now I can’t go on with my project.
Thank you in advance!


#2

You could try googling the error code. Looks like that one could be an Excel problem like Sheet not there or something.

If you provide further details we could make other suggestions.

Thanks.


#3

Thank you for the reply!
In my project, I read cells from different excel sheets.
For the first Excel sheet, UIPath does everything right.
But for the second Excel, I get the error.
You can see this in the output of my project:

Introfiches Delhaize execution started
The Filename is: LVDP_01092014_HENKEL_Perfect Mousse 500
The Department is:
The Buying Commitee date is: 09/01/2014 00:00:00
The Category Manager is: Laurence Van De Putte
The Similar Item n/size is: Laurence Van De Putte
The Supplier Company Name is: 09/01/2014 00:00:00
The National Brand Name is: Schwarzkopf
The National Subbrand Name is: Perfect Mousse
The EAN CU Number is: 5410091681975
The EAN TU Number is: 5412530766762
The Product Description is: NA
The Grammage is: Schwarzkopf Perfect Mousse 500
The Filename is: LVDP_01092014_PROCTER & GAMBLE_Head & Shoulders 2in1 citrus 450ml
The Department is:
The Buying Commitee date is: 09/01/2014 00:00:00
The Category Manager is: Laurence Van De Putte
The Similar Item n/size is: Laurence Van De Putte
The Supplier Company Name is: 09/01/2014 00:00:00
The National Brand Name is: head & shoulders
The National Subbrand Name is: head & shoulders
The EAN CU Number is: 4084500087378
The EAN TU Number is: 4084500087385
The Product Description is: H&S Citrus 2in1
The Grammage is: 450
Write Cell Department : The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Introfiches Delhaize execution ended in: 00:00:12


#4

I still have the same problem…


#5

Hi all.

I have detected the same problem and solved it.
What I guess is that UiPath is “too fast”; I mean; the “Excel Object” (from DLL) is not yet closed BEFORE the next operation, so you have to give UiPath a little more time in order to close the DLL Excel Object properly.
This can be achieved with a mere “WriteLine” or a couple of them (just one “before” and other “after”).

Give it a try! :wink:


Object invoked
Issue with excel file
#6

hi @ArturoGarciaMartin I am facing this issue related to Excel Object, and tried the solution that you provided. However it was not of much help? Do you have any more suggestion?


#7

Hey @Gourav_Kumar

Will you be able to share your scenario and how you are dealing? with excel? YOu are using excels then it is different excel or same excel instance ? and excel operation you are performing is?

Regards,!!
Aksh


#8

Hi.

Try and see whether U can reproduce it:
1.- Read an Excel file as INPUT: “Excel Application Scope” > “Read Range” > "Output Data Table"
2.- Build a new Data Table with some "dummy data"
3.- Write a new Excel file as OUTPUT, based on previous datatables: “Excel Application Scope” > “Write Range (DT1)” > “Append Range (DT2)” > “Sort Table”.

If you don’t put something to “wait some seconds” between “Excel Aplication” scopes, the error is:

"Main has thrown an exception

Source: Write Range

Message: El objeto invocado ha desconectado de sus clientes. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

Exception Type: ExcelException

UiPath.Excel.ExcelException: El objeto invocado ha desconectado de sus clientes. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)) —> System.Runtime.InteropServices.COMException: El objeto invocado ha desconectado de sus clientes. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
at Microsoft.Office.Interop.Excel._Workbook.get_Sheets()
at UiPath.Excel.WorkbookApplication.SetSheet(String sheetName, Boolean createNew)
— End of inner exception stack trace —
at UiPath.Excel.WorkbookApplication.SetSheet(String sheetName, Boolean createNew)
at UiPath.Excel.Activities.ExcelInteropActivity`1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)"


#9

please, any solution … help me, principally when i use foreach.


#10

Thank you for the good pointer. It works by a split second time for the Excel Application Scope to close before invoking the next Excel Application Scope.


#11

Try to give delay of some time between two excel application scope.
Also check is your excel.exe is open in the task bas and then run again.
I had this issue but once I apply delay between two excel application scope it got resolve.