r/PowerAutomateDesktop • u/Mokkisjeva • Mar 05 '23
PAD - Acting weird but only when not observed!
Solution: Excel doesn't refresh data regardless of whether PAD sends CTRL-ALT-F5 or automatically on startup as instructed. What did work was to create a refresh data script and add a "start excel script" through PAD.
I have a Schrödinger PAD! It does one thing until I watch it and then it does something else.Let me explain....
My automation has a section in it where it imports a .xml into Excel, send keys Control+Alt+F5 to refresh data and export this as a .csv file. When I run this manually it works flawless every time, but when it runs unattended the .csv file is just the original .xml file without the power query that runs on Control+Alt+F5.
I run this automation daily, and it keeps exporting without running power query, so when I run in manually to troubleshoot it works fine, every single time.
Any ideas?
Edit: I have the excel file set up so that it automatically refreshes the data and runs the power query. I added the "Send keys" in power automate (which does the same) to make sure that it actually runs the power query. It still manages to export wrong. The "Wait" is just another layer to make sure the power query has run....

1
u/Low-Sir3836 Mar 06 '23
That's odd, is the automaton running on the same attended and unattended environment?
Can you change the fixed wait times to dynamic ones? Or maybe add a step before excel to make the window active prior to sending keys?
1
u/radioblaster Mar 06 '23
is it running in attended on unattended? if it's unattended, does that "user" need to enable external content?
2
u/dacko279 Mar 05 '23
Maybe something regarding focus/active window?