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 / [PAD; Windows 11] Does...
Power Automate
Answered

[PAD; Windows 11] Does the "Click UI element in a window" action only work in web browsers? Any time I attempt to use it in an application (like MS Word), I get stuck with a perpetual "Wait for action" message. This is making it 10x harder to create my flow...

(0) ShareShare
ReportReport
Posted on by 9

Screenshot 2024-06-26 130628.png

 

I realize an alternative would be to have the flow click at a specified XY coordinate, but I'm hesitant to do this because the flow will be used across different computers and display sizes. Any workarounds?

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @paul_cranberry 

     

    Click UI element in a window action should work in Non-browser UI Elements as it is deisgned to action for that. Regarding wait for action to display selector- sometimes it may take time but not too longer- so did you tried it again by closing and opening the flow to see any change in detection speed ?

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • paul_cranberry Profile Picture
    9 on at

    Thanks for your response. Rather than close out of the UI picker once I got that "Wait for action" message, I tried waiting, and eventually, it worked. It took about 15 seconds of waiting before the UI element "registered." Previously, I assumed it was frozen. Turns out it just took a long time.

     

    Unfortunately, once I play the flow, it takes 45 seconds to click the element in MS Word. Any idea why? My flow is relatively short and simple: opens Word, changes some dates in the text, runs a macro, done. It's bizarre to me that it's getting bogged down by just clicking a UI element (the "Macros" button under the Development tab).

  • Verified answer
    NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @paul_cranberry !

     

    Instead of using "Click UI element", use "send keys" action.

    Here is one flow:

    NathanAlvares24_2-1719426699786.png

     

    So I open my word file, find and replace the text maybe a date or simple text and then switch to the developer tab using send keys.

     

    Configuration of some actions:

    This action is to go to developer tab, and then click on the macros section

    NathanAlvares24_3-1719426800444.png

     

    Then this will send keys like up or down depending on how many macros are there. So the no. of up and down keys will change based on how many macros are there and which specific macro you wish to run. Then simply hit enter key to run the macro.

    NathanAlvares24_4-1719426811368.png

     

    my macros:

    NathanAlvares24_5-1719426965518.png

    This is just a test so my macros are blank.

     

    If the process of macros are huge, try to put "Wait" action after this before closing the word file.

     

    Code (just copy and paste into your flow):

    Word.LaunchWord.LaunchAndOpen Path: $'''C:\\Users\\UserName\\Desktop\\Doc1.docx''' Visible: True ReadOnly: False Instance=> WordInstance
    UIAutomation.SetWindowState.SetStateByInstanceOrHandle WindowInstance: WordInstance State: UIAutomation.WindowState.Maximized
    # find the text to replace with
    Word.FindAndReplaceWord.FindAndReplaceAllWithoutWildcards Instance: WordInstance TextToFind: $'''June 26, 2024''' TextToReplaceWith: $'''26th June 2024''' MatchCase: True MatchEntireWord: False
    # Go to developer tab and then go to macro tab
    MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: WordInstance TextToSend: $'''{Alt}({L}){PM}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: True
    # Select the macro using up and down keys (if many) to select your macro. This needs to be changed if you want a particular macro. Then hit Enter to run the macro
    MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: WordInstance TextToSend: $'''{Down}{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: True
    # Close and save the word file
    Word.CloseWord.CloseAndSave Instance: WordInstance

     

    Before:

    NathanAlvares24_0-1719426619016.png

     

    Between this a macro will run using the send keys.

     

    After:

    NathanAlvares24_1-1719426630736.png

     

    I hope this helps.

  • paul_cranberry Profile Picture
    9 on at

    I like the idea of using Send Keys instead of UI elements. Great solution.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard