web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel breaks if the us...
Power Automate
Answered

Excel breaks if the user has their cursor in a cell

(0) ShareShare
ReportReport
Posted on by 375

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

  • Verified answer
    Gidi Profile Picture
    601 on at

    Hi BradonK,

    try to send Enter or Escape key, after User confirms with OK button, before continue with Excel activities. 

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    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.

  • BradonK Profile Picture
    375 on at

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard