Enabling sub menu items via vba

D

Dan Neely

I'm using an activeX container to embed an excel document into my app. It
has several menu items I need to use disabled though. Since I don't want to
try and figure out how the ~400k of c++ source works to fix the problem I'm
trying to do it in vba. The problem is with the change tracking menu item
group. I can enable the main item on the tools menu, but not the subitems
that popup when it's selected. I can't figure out how to access the subitems
to enable them. The code below includes how I've enabled the track changes
item as well as 3 unsucessful attempts to enable the Highlight CHanges
subitem.

Sub EnableTracking()
'This works but doesn't affect it's children
Application.CommandBars("Tools").Controls("Track Changes").Enabled = True
'this generates an runtime error
Application.CommandBars("Tools").Controls("Highlight
Changes...").Enabled = True
'As does this.
Application.CommandBars("Track Changes").Controls("Highlight
Changes...").Enabled = True
'This doesn't generate an error but doesn't work either.
Application.CommandBars("Tools").Controls("Track
Changes").Controls("Highlight Changes...").Enabled = True
End Sub

activeX container location
http://support.microsoft.com/default.aspx?scid=kb;en-us;311765
 

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