Hi,
I am trying to create a Power Automate desktop flow to open multiple excel files of the type .xls and convert it into .xlsx.
I have enclosed the file with the steps. On running the flow, the application does the job perfectly for the first work book via some components + desktop recording. However, when it tries to run for the subsequent workbooks, it throws an error as below.
Failed to press button (failed to get window)
1) It works fine for just one excel file that I recorded (ex: Book1.xls) and stops for the next excel file (Book 2.xls) though the tool bar of excel application never changes and I am passing the latest file name as a variable for the flow to look into every time. How can this be fixed? I see that the UI element is showing as "Window 'Book1- Excel'>Button 'File Tab' and is not recognizing the file tab for the next workbook that it has to convert.
2) Also, is there any alternative way of doing this via desktop power automate without using desktop recording?
Solved! Go to Solution.
Your flow is fine, it is your UI elements. They are all pointed at Window "Book1", so it's not able to point at the next set when you go to the next file. Do this:
In the far right pane of edit mode, select the icon for UI selectors:
Hover over the right edge of Window 'Book1.xlsx - Excel' and left click the 3 dots that appear:
Click on Edit Selectors:
Hover over the text that appears and again, select the 3 dots on the right, and click Edit Selector again:
Here, simply uncheck the "Name"
It will, by default, use the Excel program that is open, ignoring the name "Book1" and working for any open Excel UI. All the other UI selectors should be a subset of the Window "Book1", so when you remove Window from this header selector, all the others should fall in line.
Notice how my selectors are all subsets of Window "PartnerCloseRequests":
So, if I were to uncheck Name, then these 3 selectors would work for any open excel window.
Best of Luck!
Hi @SA41
For point no 2:
After the 'Launch Excel' action use the below
-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.
Your flow is fine, it is your UI elements. They are all pointed at Window "Book1", so it's not able to point at the next set when you go to the next file. Do this:
In the far right pane of edit mode, select the icon for UI selectors:
Hover over the right edge of Window 'Book1.xlsx - Excel' and left click the 3 dots that appear:
Click on Edit Selectors:
Hover over the text that appears and again, select the 3 dots on the right, and click Edit Selector again:
Here, simply uncheck the "Name"
It will, by default, use the Excel program that is open, ignoring the name "Book1" and working for any open Excel UI. All the other UI selectors should be a subset of the Window "Book1", so when you remove Window from this header selector, all the others should fall in line.
Notice how my selectors are all subsets of Window "PartnerCloseRequests":
So, if I were to uncheck Name, then these 3 selectors would work for any open excel window.
Best of Luck!
Hi @SA41
For point no 2:
After the 'Launch Excel' action use the below
-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.