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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Set checkbox sta...
Power Automate
Unanswered

Excel Set checkbox state fails

(0) ShareShare
ReportReport
Posted on by 9

I'm using the Set checkbox state in window action and want to set it to Unchecked. The initial state is unknown, it may be checked or unchecked. When I use the action, it does not uncheck it if it is in a checked state. There is no error.

Specifically I'm using the Subtotal function from Outline. I want to check the Stock checkbox and uncheck the Sector checkbox. This is how the dialog box opens most of the time. The check/uncheck isn't working. Any thoughts? Thanks!

PAD_Charles_0-1635468740447.png

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @PAD_Charles 

     

    This may definitely have to got to do with the selectors.

    For a windows application this should work without any issues, unless the selectors are incorrect. Can you share what your selectors show for the checkboxes.

  • Highboy Profile Picture
    1,183 Super User 2024 Season 1 on at

    Hmmm can't get it to work either.
    Tried with the "Set checkbox state" and it only highlights the checkbox text.
    But I can click it by using "Click UI element in window", if I ask it to click left, with X offset at 10.
    If I don't use an offset of 10 then it will click just left of the checkbox.

    My selector

    The selector below is made short by me, have tried with the one that PAD catches, and same result.

    Highboy_0-1635499200795.png


    My click action

    Highboy_1-1635499253709.png

     

     

  • PAD_Charles Profile Picture
    9 on at

    Hi, thanks for trying to help. Is this what you're looking for?

    > window[Class="bosa_sdm_XL9"][Name="Subtotal"] > list[Name="Add subtotal to:"] > checkbox[Name="Sector"]

  • Highboy Profile Picture
    1,183 Super User 2024 Season 1 on at

    I don't think it's a selector problem.
    Btw.: You can make your selector as short as this 
    checkbox[Name="Sector"]

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    I've previously experienced that the subwindows in Excel work inconsistently when activated with the regular actions.

    What you might need to do, is check whether or not the checkbox is checked, and if we have to click on it, use the following code:

    UIAutomation.GetElementDetails Element: appmask['Window \'Create Sparklines\'']['Button \'OK\''] AttributeName: $'''Location and Size''' AttributeValue=> AttributeValue
    Text.SplitText.SplitWithDelimiter Text: AttributeValue CustomDelimiter: $''', ''' IsRegEx: False Result=> TextList
    Variables.TruncateNumber.RoundNumber Number: TextList[2] / 2 + TextList[0] DecimalPlaces: 0 Result=> X
    Variables.TruncateNumber.RoundNumber Number: TextList[1] + TextList[3] / 2 DecimalPlaces: 0 Result=> Y
    MouseAndKeyboard.SendMouseClick.ClickAt ClickType: MouseAndKeyboard.MouseClickType.LeftClick MillisecondsDelay: 0 X: X Y: Y RelativeTo: MouseAndKeyboard.PositionRelativeTo.Screen MovementStyle: MouseAndKeyboard.MovementStyle.Instant
  • PAD_Charles Profile Picture
    9 on at

    Thanks for posting this. I don't know how to add code to Power Automate Desktop, but this gave me the idea to check the state of each checkbox and "check" it if needed.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard