Exception from HRESULT: 0x800401A8

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!

1 Like

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.

1 Like

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

1 Like

I still have the same problem…

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:

8 Likes

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?

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

1 Like

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

2 Likes

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

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.

2 Likes

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.

is there any uipath responsbile help about this topic?

no help, no vidoes nothing…

works first time, after that no working. same error all the time… and nobody helped.

A delay resolved this for me as well. But instead of using WriteLine, I inserted a Delay activity. Note I added it outside of the ExcelApplicationScope and in my case I added a half second delay by setting the following duration value: TimeSpan.FromSeconds(.5)

2 Likes

Hi Sangram.

I’m aware that we can query the existence of process named “EXCEL.EXE” using the method Process.GetProcesses(), and to keep using the delay activity while that excel process is still active.

But what about if that particular excel process never cease to terminate by itself? Should I manually terminate it? (given that excel process was triggered by an Excel Application Scope available in my project)

Hi Cong Nguyen.

How do we determine that a certain timespan is good enough? I mean, is a 0.5 second delay a global solution, or is it only for your case?

Hello guys. Have anybody really solved the problem for the exception 0X800401A8? Does anybody tell me any tip to solve this problem? I’m coding a simple bot which opens a plan and read a sheet then this message appears. I’ve tried to google and read some documents at the UI Path portal but I didn’t found any solution.

best regards

It’s difficult to say without more details, like describing when the error happens, maybe what things you have tried, is there any popups that occur when you manually open the file.?

A tip is to always use the Close Workbook activity at the end of an Excel Scope so the Excel object is closed. If it is left open for whatever reason, it can cause errors. Also, when using Read Range, always check the Read-only option. Also, ensure you have latest Excel package installed.

Regards.

1 Like

Thank you for the tip Clayton. But my problem is simplier. I’m trying just open a sheet as my first task then read data. There’s no other activity. There

There’s no excel task opened. I think UIpath doesn’t recognizes excel. Iwill try to read such file on web. I mean using excel online.

regards

You can open the file manually with Microsoft Excel, right?