Thread: Index Popup
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Index Popup

There was a typo

if Worksheets("Opening Cover").OleObject("CheckBox1").Object.Value then
cbcCutomMenu1.Enabled = False
End if


should have been

if Worksheets("Opening Cover").OleObjects("CheckBox1").Object.Value then
cbcCutomMenu1.Enabled = False
End if

Yes, you will need alter the menu based on the click event of the checkbox.
You don't necessarily need to rerun addmenus, you could just set the enable
property of the control to false. you would have to address it like

CommandBars("Something").Controls("MyMenu").Enable d = False ' or true

"Something" would be the name of the commandbar on which it is located.

--
regards,
Tom Ogivly


"Newbeetle" wrote in message
...
Hi Tom,

I figured it out, I got checkbox1 to run macro "addmenus" everytime its
checked or unchecked.

Thanks for the help with this, its really been appreciated.

"Newbeetle" wrote:

Hi Tom,

I tried the code amendment but I get an error on the if statement, I have
checked the code but cant see the wood for the tree's from staring too
long!

I then tried some amendments and ended on;

If Sheets("Opening Cover").CheckBox1.Value = False Then
cbcCutomMenu1.Enabled = False
End if


If I run the excel program after saving with checkbox 1 unchecked, the
Apple
is not enabled.
If I run the excel program after saving with checkbox 1 checked, the
apple
is enabled.

I cant though get this function to work when checking/un-checking the
checkbox in the open workbook.

Yep I'm stuck yet again, any thoughts appreciated!