I have a UIPath Macro that extracts data from SAP BI and downloads it to a spreadsheet. This file is in the format of a Single File Web Page. Then the macro opens this file with the UiPath Activity ‘Excel Application Scope’. This process works perfect 98% of the time. However occasionally SAP BI gives an incomplete file. Then the Excel Application Scope shows the popup message "MyFileName is not a valid Single File Web Page. " and the macro just freezes. I would expect a timeout error on my next activity, but no it just hangs. How can I handle this situation, so I can move forward in the macro?
Thanks for your response! Perhaps I don’t understand, but I think we have terminology mix-up. When I said I have a “UiPath macro” I mean a UIPath Studio project. I do not have an Excel Macro that I could add your error handling code to.
The issue is when I open the spreadsheet with the UiPath Activity ‘Excel Application scope’ If the file was not downloaded completely for whatever reason I het this popup error. I need this unexpected popup to trigger an error which my existing try/catch logic will retry the process.
if that error popup is causing UiPAth to freeze, then its probably blocking the current execution thread.
So we need a separate thread (using “parallel activity” + “Isolated” property) to check if the popup exists and click it
In this diagram, the left sequence will be your main sequence that downloads the excel.
The right sequence (try click popup.xaml) will be the parallel sequence that clicks the error popup if it exists
“try click popup.xaml” will be a loop. It will keep looping until
it sees the error popup (then it will click popup and throw exception), or
excel application scope runs successfully (then it will stop looping)
This is why when excel application scope runs successfully, i added a “write text file” activity to create a text file. Then in “try click popup.xaml”, it will stop looping if this file exists.