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

Community site session details

Session Id : U+d+QFss5fPeoVIACly51U
Power Automate - Power Automate Desktop
Answered

Excel breaks if the user has their cursor in a cell

Like (0) ShareShare
ReportReport
Posted on 11 Jan 2024 00:56:12 by 359

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

  • BradonK Profile Picture
    359 on 11 Jan 2024 at 22:50:19
    Re: Excel breaks if the user has their cursor in a cell

    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!

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on 11 Jan 2024 at 09:46:45
    Re: Excel breaks if the user has their cursor in a cell

    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.

  • Verified answer
    Gidi Profile Picture
    596 on 11 Jan 2024 at 06:38:04
    Re: Excel breaks if the user has their cursor in a cell

    Hi BradonK,

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

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete