Hi all,
I am having a bit of an issue with Excel.
I have a flow that opens a blank excel spreadsheet, then pops up a message box telling the user to add their data, then click OK on the message box.
If the user adds their data and clicks out of the last cell they were typing in , it works fine. But if the user clicks the OK button with their cursor still active in a cell, any further excel actions fail.
Is there a way to force the cursor out? Or a way to stop this happening?
Thanks
Hi @Agnius ,
Thanks for the info. I would have preferred to not have a excel spreadsheet that the user uses, but it's there so that the user can simply paste data from another spreadsheet into the one that Power Automate opens. I could not find a way to paste a selection from an excel spreadsheet directly into a list variable from PAD and I couldn't find a way to let the user pick an open excel document to use similar to how with browser automation you can let the user click on the browser window they want and then PAD will attach to it.
If you have any ideas on a better way to do so I would appreciate it, but for now it seems like the enter key is my best friend as you and @Gidi said.
Thanks for the help both of you!
This can also be pretty clearly reproduced manually, when, for example, you have an active Excel spreadsheet, where you've started typing into a cell, and have not closed it, and then try to open a new sheet - Excel will pause that and will not actually open the new document before you close the active cell. This is an Excel thing, and not really a PAD issue.
As @Gidi suggested, the best solution to work around this, is likely to send some keys to the sheet after they press OK. In most cases, sending an Enter or Escape key will do nothing if the cell is not activated, and will close it if it is. But if you send Escape, the changes that the user made will not be saved, so, using Enter is a better idea, if you're collecting inputs this way.
Alternatively, you could simply pop out an input dialog instead, and ask them to populate that, instead of writing into Excel. Then use the Excel actions to write the data into the sheet via PAD, instead of allowing the user to do it. Users and automated Excel files are not really a great idea in general, as the biggest bug in your flow is almost always the part between the keyboard and the chair 🙂
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
Hi BradonK,
try to send Enter or Escape key, after User confirms with OK button, before continue with Excel activities.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2