How to employ ExecuteMso Sub in Excel 2007?

J

JeffreyW

As I found out in an earlier post at:

http://msdn.microsoft.com/newsgroup...icedev-excel&lang=en&cr=US&sloc=en-us&m=1&p=1

.... the Application.CommandBars.ExecuteMso method apparently does not work
with a Gallery Control in Excel 2007.

I subsequently came across this info at:

http://msdn2.microsoft.com/en-us/library/aa722523.aspx

"The Application.CommandBars class provides the following methods for
interacting with Fluent UI controls.

Table 1. Methods for the Application.CommandBars class
Method | Description:

Sub ExecuteMso(idMso As String) | Executes the command that is specified in
idMso."

I seem to have problems getting this to work with a Gallery control as well
- maybe because of the same issue as above or maybe because I am messing
something up. Can anyone suggest how I might successfully use this method to
call a Gallery Control like "CellStylesGallery" (which is a correct idMSO)?

Thanks for any insights.

Jeff
 
J

Jim Rech

Since ExecuteMso does not work with gallery controls (apparently) the only
other option I can think of is sendkeys:

Sub aa()
SendKeys "%H"
SendKeys "J"
End Sub


--
Jim
| As I found out in an earlier post at:
|
|
http://msdn.microsoft.com/newsgroup...icedev-excel&lang=en&cr=US&sloc=en-us&m=1&p=1
|
| ... the Application.CommandBars.ExecuteMso method apparently does not
work
| with a Gallery Control in Excel 2007.
|
| I subsequently came across this info at:
|
| http://msdn2.microsoft.com/en-us/library/aa722523.aspx
|
| "The Application.CommandBars class provides the following methods for
| interacting with Fluent UI controls.
|
| Table 1. Methods for the Application.CommandBars class
| Method | Description:
|
| Sub ExecuteMso(idMso As String) | Executes the command that is specified
in
| idMso."
|
| I seem to have problems getting this to work with a Gallery control as
well
| - maybe because of the same issue as above or maybe because I am messing
| something up. Can anyone suggest how I might successfully use this method
to
| call a Gallery Control like "CellStylesGallery" (which is a correct
idMSO)?
|
| Thanks for any insights.
|
| Jeff
 
J

JeffreyW

Thanks for posting, Jim. I was hoping someone might be able to show me the
error of my ways so I could employ the "Sub ExecuteMso(idMso As String)"
procedure to execute a Gallery control ... but if the documentation in
"Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)" link
above is wrong (or incomplete) and that's not possible, I might have to
resort to using SendKeys but would prefer to avoid it if possible due to
possible Windows timing issues.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top