View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge[_2_] Nick Hodge[_2_] is offline
external usenet poster
 
Posts: 185
Default Making Application.CommandBars.ExecuteMso method work in 2007

Jeffery

Not quite got what you are seeing here, but to get the Mso of any control go
to Office ButtonExcel OptionsCustomize and change the drop down to 'All
Commands', find the control in the list, hover over it until the tooltip
appears and the 'Mso' is the name in brackets e.g. (TextBoxInsertText), you
can then try using that in your VBA after the ExecuteMso statement.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk




"JeffreyW" wrote in message
...
In the Excel 2007 VBA Programmer's Reference (by John Green, Stephen
Bullen,
Rob Bovey and Michael Alexander), they state:
-----
"As well as being able to retrieve the state information, you can also
click
any built-in control using the new ComandBars.ExecuteMso method. This is
extremely useful for triggering those actions that dont have an object
model
equivalent€”such as putting the user in drawing mode to draw a text box on
a
sheet:"

Application.CommandBars.ExecuteMso €śTextBoxInsertExcel€ť
-----

While the above works, when I try to use this method with a gallery
control,
like:

Application.CommandBars.ExecuteMso "CellStylesGallery"

I expect either the book is wrong (i.e., the method does not apply to "any
built-in control"), or there is some syntax I have wrong in applying this.
Can anyone advise how to make this work?