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 / [Send key] is prone to...
Power Automate
Unanswered

[Send key] is prone to errors?

(0) ShareShare
ReportReport
Posted on by 409

I found that there are too many [Send key], the process is too fast and it is easy to cause the wrong position, so I need to add [Wait 1s] as a buffer, but I don’t know where to insert it, do you have any suggestions?

螢幕擷取畫面 2023-07-06 133929.png

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Of course, Send keys is prone to error, because it does not verify in any way whether the keys in fact resulted in the outcome you expected.

     

    The best practice is to not use Send keys at all, if possible. If you absolutely need to use it, you should add verification actions, such as Wait for imageWait for windowWait for window content, etc., to check if the keystrokes did what they were supposed to do.

     

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution.

    If you like my response, please give it a Thumbs Up.

     

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • alee001 Profile Picture
    409 on at

    Because my Excel files is not opened from PAD, [Send key] must be used to operate the cells and range.

     

    Just don't know how to control its buffer and how much it needs?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can use the Attach to Running Excel action to attach to it and then use the related Excel actions. Automating the Excel UI is always a bad idea. Doing it with Send keys is an even worse one.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution.
    If you like my response, please give it a Thumbs Up.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • alee001 Profile Picture
    409 on at

    If you use [Attach to Running Excel], it is better to use [Run Excel] at the beginning.

     

    The UI operation is used because the file (pre-opended) has a large degree of freedom, and the [Send key] operation process is obviously faster than others.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    That is incorrect. Attach to running Excel is specifically used when Excel is already running and you cannot use Run Excel. These two are never used together, because there is no reason whatsoever to use Attach to running Excel when you are already using Run Excel. All that Attach to running Excel does is create an Excel instance variable to be used for other Excel actions, and Run Excel already does that.

     

    So, you are wrong there. If you already have an Excel file that is open and need to do something with it, Attach to running Excel is exactly what you need to do.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution.
    If you like my response, please give it a Thumbs Up.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • alee001 Profile Picture
    409 on at

    Although some operations of [Send key] are limited, it is easier to write than executing automated Excel.

     

    Thank you for your explanation, I will learn more and try.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    It seems easier to create Send keys actions, but it is much harder to make them work. If it wasn't, you would not be posting so many topics asking for help on your project 😊

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard