I have a macro called CloseExcel. it contains simply Application.Close. Obviously I’m looking for a reliable way to close excel when I’m done with it and clicking X isn’t working for me. I’ve called excel macros reliably before so I thought this was a good way but it threw an exception:
Source: Execute macro
Message: Exception from HRESULT: 0x800AC472
Exception Type: ExcelException
UiPath.Excel.ExcelException: Exception from HRESULT: 0x800AC472 —> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472
at Microsoft.Office.Interop.Excel.ApplicationClass.Run(Object Macro, Object Arg1, Object Arg2, Object Arg3, Object Arg4, Object Arg5, Object Arg6, Object Arg7, Object Arg8, Object Arg9, Object Arg10, Object Arg11, Object Arg12, Object Arg13, Object Arg14, Object Arg15, Object Arg16, Object Arg17, Object Arg18, Object Arg19, Object Arg20, Object Arg21, Object Arg22, Object Arg23, Object Arg24, Object Arg25, Object Arg26, Object Arg27, Object Arg28, Object Arg29, Object Arg30)
at UiPath.Excel.WorkbookApplication.RunMacro(String macroName)
— End of inner exception stack trace —
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)