how to resolve The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))
I ended up removing:
PowerPoint_App.Visible = MsoTriState.msoTrue;
And it worked...!!!
I'm working through a similar problem (controlling Excel via PowerShell), and wanted to add that -- in a way I cannot begin to explain -- the analogue to @Milind Anantwar's suggestion caused my script to start working.
More details, in case they help:
In my case, everything worked fine when run locally. I started seeing the
Application is busy
exception only when I moved to executing via an Azure Hybrid Worker Runner.
With reference to the following snippet, I was seeing the exception after line 2, but removing line 2 "fixed" the problem:
$excel = New-Object -ComObject Excel.Application $excel.visible = $SHOW_EXCEL $workbook = $excel.Workbooks.Open($_excel_file)
I saw the exception when
$SHOW_EXCEL
was set to$false
.