Sign in to follow this  
Followers 0
Rishav

Clicking MS Excel toolbar button

3 posts in this topic

Hi folks

Currently i am working of a software which has buttons quite similar to MS excel toolbar buttons.

this creates a problem in getting the control id for automation as .net all the buttons on the toolbar have the same class-instance names.

in general, lets say i want to click on the Bold button on the Excel toolbar. how can i do that?

Posted Image

using

;ControlFocus("Microsoft Excel - Book1","","CLASS:MsoCommandBar; INSTANCE:1")

just tries to click the toolbar itself instead of that very button.

Share this post


Link to post
Share on other sites



Hi folks

Currently i am working of a software which has buttons quite similar to MS excel toolbar buttons.

this creates a problem in getting the control id for automation as .net all the buttons on the toolbar have the same class-instance names.

in general, lets say i want to click on the Bold button on the Excel toolbar. how can i do that?

Posted Image

using

;ControlFocus("Microsoft Excel - Book1","","CLASS:MsoCommandBar; INSTANCE:1")

just tries to click the toolbar itself instead of that very button.

Is there a reason you can't just use something like Send("^b")?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi folks

Currently i am working of a software which has buttons quite similar to MS excel toolbar buttons.

this creates a problem in getting the control id for automation as .net all the buttons on the toolbar have the same class-instance names.

in general, lets say i want to click on the Bold button on the Excel toolbar. how can i do that?

Posted Image

using

;ControlFocus("Microsoft Excel - Book1","","CLASS:MsoCommandBar; INSTANCE:1")

just tries to click the toolbar itself instead of that very button.

That's because "CLASS:MsoCommandBar; INSTANCE:1" IS the toolbar, not the button.

:)

P.S. You might check out this topic: winwait, for selection of menus

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0