Excel macro issue. HRESULT: 0x80020009 (DISP_E_EXCEPTION)


I experience an issue that completely jeopardizes my project. The bot has to run a macro that will open a set of 7 .XLS workbooks downloaded from SAP and put them together. The macro runs smoothly when I run it normally without UiPath. With UiPath, its behaviour is unpredictable and will crash or provoke the mentioned error.

During months, I only had the issue while running the bot unattended (from Orchestrator), I thought I fixed it with a delay, but the problem came back again recently. Now it happens, or not, either in attended or unattended mode, but especially in unattended mode, even though sometimes it works. The process was running smoothly for months, and I did not change the macro at any point!

After realizing that the second macro was running fine I tried to amend the code of the first one, but it’s the workbook.open method that is the issue. I can’t modify this without just abandoning the macro itself, which I do not wish to do.

Has anybody run into this kind of situation and could help me?

Thank you so much for any help at all.


Even I am facing the same issue. Can anyone suggest any workaround here plz?



Is your issue resolved? I am facing this error HRESULT:0x80020009 while executing a macro.