How to automate in excel the file-open split button?

Hello,

I want to open an excel-file writeprotected.
So I have to click on the down-arrow in the file-open-menu of Excel
(see screenshot)

How can I navigate savely to this point.
I tried with click-activity and select-item-activity.
The latter don’t work and the first one works neither due to not finding the right selectors.

Any help is appreciated - thanks in advance!

Kind regards

Maybe not the best way but you can use a type into activity - the selector is the down arrow with the following:
“[k(down)][k(down)][k(down)][k(enter)]”

In the properties, make sure sendwindowsmessages is checked and also clickbeforetyping

1 Like

Great, thanks!
Never thought about sending a keystroke…
Sending one down opens the split-menu,
then I can use a click-activity.

I used as workaround a click-image,
but now, I think, it is more robust.

Don’t use select item activity for this, as I don’t believe it’s actually a dropdown list. Just use click activity on the down arrow, then another click activity to select which one you want

That’s what i tried - as you surely read.
Can you provide the appropriate selectors for clicking the arrow?
As mentioned,I cant find working selectors.

Just FYI - I think Key Strokes are a lot more secure in automation rather than clicking.

<wnd app='excel.exe' cls='#32768' />
<ctrl name='Context' role='popup menu' />
<ctrl automationid='2' />

Those are the selectors for the “Open Read-Only”, which is the second option that I see.

click

I dislike using keystrokes without selectors, because it can be easily interfered with if say a popup occurs asking for a windows update, or any other number of things that can happen randomly.

However, I have used them quite a bit throughout various workflows when selectors are not available, or it is just much quicker to do. So they definitely have their place and perhaps it’d be easiest to simply use them here :slight_smile:

Thanks for your reply.
Which version of excel do you use?
I have to use Excel 2010 (which i should have mentioned :wink: )
Unfortunaly here the selectors seem not to work…

For sending the keystroke I use “send hotkey” - and there are selectors.

Edit: I’m wrong. Your selctor is for clicking the entry in the list - this is what I use already. I need the selector for clicking the arrow…

Dropdown for the Arrow:

<wnd app='excel.exe' cls='#32770' title='Open' />
<wnd ctrlid='1' title='&amp;Open' />
<ctrl name='Open' role='split button' />
<ctrl role='drop down button' />

This one, I tried already, validates but don’t work: Click generic error

It works for me but try using an attach window -

<wnd app=‘excel.exe’ cls=’#32770’ title=‘Open’ />

Then in the click

<wnd ctrlid=‘1’ title=’&amp;Open’ />
<ctrl name=‘Open’ role=‘split button’ />
<ctrl role=‘drop down button’ />

Thanks for your reply.
I tried, but without success. I get still a “Click generic error”!
(That’s not that tragic, since the “send-hotkey” works.)