Unable to find stable selector for Excel 16 Print options

Hi all,

As per title, I am unable to find a stable selector for the element in Excel 16’s Print Menu which allows you to enter the Page you want to type from:


I have used a regular selector for it by using “indicate element on screen”, UiExplorer to get a more complete selector, and using “record” which prompted me to set an anchor (as the selector is unstable), which I selected the text “Pages” for. None of these selectors seem to work.

To make this potentially more complicated, I am running the bot on a VM, and developing on my laptop, so I’m using my Excel to find the selector, where it more often than not works, but on the VM it never works. The VM is running the same version of Excel I am however.


1 Like

Few questions:

a. You have an attach window?
b. Can you put your selector for:

  1. Anchor
  2. Action

It’s in the attach window alongside the other settings which work:

1 Anchor is:
<wnd app='excel.exe' cls='XLMAIN' />
<wnd cls='NetUIHWND' idx='1' />
<ctrl name='Backstage view' role='pane' />
<ctrl name='Print' role='pane' />
<ctrl name='Print' role='grouping' />
<ctrl name='Pages:' role='text' />

2 Action is:
<ctrl role='editable text' />

These are the ones generated by the Recording tool, and I just ran on my laptop and it worked, but still won’t find these on the VM which is running the same Excel.


Edit: Expanded selector for the action is:
<wnd app='excel.exe' cls='XLMAIN' />
<ctrl name='Pages:' role='editable text' />

Its always working on your local machine but not at all on the VM?

I can suggest, you do like this.
In the anchor use a find element which will find the textbox element for you.
And then in your type into, do not indicate, rather pass the findElement output element var in the properties–>Element
That way input field selector will always get the stable selector for input field.

Note: Use Activate, ClickBeforeTyping options

Not sure if it will solve your VM related issue. But if its stabilizing the text box selector this should help.

Thought this would be my solution! But it looks like Find element can’t find the element…?


What is your selector now for findElement?

1 Like

I’ve managed to get round this, I was only needing this as I didn’t want to print the first tab of the workbook, so instead I have just hidden it and I get the same result. Thanks anyway, when this project is finished I will come back to this and make it work! Right now I don’t have time :frowning:

1 Like

Sure, :slight_smile:

1 Like