Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba

'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("Highlig ht
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...b;en-us;311765
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Enabling sub menu items via vba

This works for me

With Application.CommandBars("Tools").Controls("Track Changes")
.Enabled = True
.Controls("Highlight Changes...").Enabled = True
End With


--
HTH

Bob Phillips

"Dan Neely" wrote in message
...
'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("Highlig ht
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...b;en-us;311765



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba



"Bob Phillips" wrote:

This works for me

With Application.CommandBars("Tools").Controls("Track Changes")
.Enabled = True
.Controls("Highlight Changes...").Enabled = True
End With


This worked when I opened the worksheet in excel directly, but not when I
tried running it inside the control the highlight changes option remained
nonfunctional. Which unfortunately means I'm probably sunk unless I can
figure out how the control itself works well enough to fix the problem.
*sigh* I really doubt my c++ skills are upto that.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Enabling sub menu items via vba

What control? Are you running it outside of Excel, VB, Access or something?

--
HTH

Bob Phillips

"Dan Neely" wrote in message
...


"Bob Phillips" wrote:

This works for me

With Application.CommandBars("Tools").Controls("Track Changes")
.Enabled = True
.Controls("Highlight Changes...").Enabled = True
End With


This worked when I opened the worksheet in excel directly, but not when I
tried running it inside the control the highlight changes option remained
nonfunctional. Which unfortunately means I'm probably sunk unless I can
figure out how the control itself works well enough to fix the problem.
*sigh* I really doubt my c++ skills are upto that.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba



"Bob Phillips" wrote:

What control? Are you running it outside of Excel, VB, Access or something?


The activeX document container I mentioned in my first post. I'm using it
to embed office documents into my application. The zip in the knowledge base
article contains binaries including a testapp, as well as the source (10k
lines of c++ using winapi instead of mfc).

http://support.microsoft.com/default...b;en-us;311765


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Enabling sub menu items via vba

How did you 'try to run it inside the control'?

--
HTH

Bob Phillips

"Dan Neely" wrote in message
...


"Bob Phillips" wrote:

What control? Are you running it outside of Excel, VB, Access or

something?

The activeX document container I mentioned in my first post. I'm using it
to embed office documents into my application. The zip in the knowledge

base
article contains binaries including a testapp, as well as the source (10k
lines of c++ using winapi instead of mfc).

http://support.microsoft.com/default...b;en-us;311765



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba



"Bob Phillips" wrote:

How did you 'try to run it inside the control'?


Started the test app. Loaded my test sheet inside, went to Tools-Macros and
ran the Enable macro. Combined with the equivilent Disable one I wrote for
testing I was able to toggle availability of the Track Changes menu item, but
not the highlight changes subitem that actaully does the work. As I said
before running the SS in standalone Excel made both of them cycle.
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba



"Bob Phillips" wrote:

How did you 'try to run it inside the control'?


If any of it matters, I'm running XPpro and Office03 .
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Enabling sub menu items via vba

No, it would seem to be something in the control, as expected, which will be
closed code.

--
HTH

Bob Phillips

"Dan Neely" wrote in message
...


"Bob Phillips" wrote:

How did you 'try to run it inside the control'?


If any of it matters, I'm running XPpro and Office03 .



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling sub menu items via vba



"Bob Phillips" wrote:

No, it would seem to be something in the control, as expected, which will be
closed code.


The code's open but it's a large enough chunk that actaully figuring out
what the problem is and how to fix it will likely be prohibitive. Unless a
better control turns up somewhere we'll probably be forced to choose between
doing without and using automation of some sort instead. On the off chance
that my boss does decide to fix/extend the control though would MS take the
extension as submission for msdn?


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Enabling sub menu items via vba

No idea. My instinct would be no unless it is outstanding, but you could
try.

--
HTH

Bob Phillips

"Dan Neely" wrote in message
...


"Bob Phillips" wrote:

No, it would seem to be something in the control, as expected, which

will be
closed code.


The code's open but it's a large enough chunk that actaully figuring out
what the problem is and how to fix it will likely be prohibitive. Unless

a
better control turns up somewhere we'll probably be forced to choose

between
doing without and using automation of some sort instead. On the off

chance
that my boss does decide to fix/extend the control though would MS take

the
extension as submission for msdn?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling sub menu items via vba Dan Neely Excel Worksheet Functions 0 July 11th 05 04:48 PM
Help with Enabling / Disabling Menu Items..! Applewine[_2_] Excel Programming 1 June 13th 05 10:37 PM
Enabling shortcut menu Slypaw Excel Discussion (Misc queries) 3 March 16th 05 12:37 AM
Enabling a menu item MoonWeazel[_2_] Excel Programming 2 July 7th 04 11:54 AM
enabling custom meu items? John[_37_] Excel Programming 1 July 18th 03 01:54 PM


All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"