How to get rid of "Exception from HRESULT: 0x800A9C68" error


I have gone through almost all the thread relating to “Exception from HRESULT: 0x800A9C68” error in this forum. However, i am unable to get rid of this error.

I have 7 macro files inside a workbook sheet. Have to invoke one by one after each macro completes its run.

As soon as the first macro completes its work i’m getting this error. Any help is appreciated.

To provide more info:

  1. I am using excel application scope
  2. Using Execute Macro activity
  3. I am not authorised to change any content inside the macro. All i should be doing is to invoke them.
  4. Using an “On element appear -> Click activity” on parallel to handle one of the known popups


Message: Exception from HRESULT: 0x800A9C68

Exception Type: System.Runtime.InteropServices.COMException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A9C68
at UiPath.Excel.Activities.ExecuteMacro.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)

Please check if your macro’s are closing the workbook before the second Invoke VBA activity @SudhakarAs92. May be that is the issue :slight_smile:

Thanks for the response. Let me check.

If yes, what should be my work around to tackle that?

I hope you will have a code of wb.close() or excel.quit()… remove those lines as you want the other Macros also run in the same workbook @SudhakarAs92

Certainly there will be multiple wb.close() available in the macro.

However, I am unauthorised to edit or remove them from the code. Any other alternative to over come this?

1 Like

Alternative @SudhakarAs92 ,

If you are ok with running the Macros individually, try using different excel application scopes for running multiple macros. But will also give you the error as your excel is being closed by the macro and excel application scope still looks to close the same excel :slight_smile:

Okay. This seems to be workable with a Try-catch block for excel application scope

Yes, May be that will work @SudhakarAs92. Try and let me know if it helps :slight_smile:

1 Like

It does @HareeshMR. Thanks!

1 Like

Glad you got the solution :slight_smile:

Happy to help @SudhakarAs92

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.