Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Amit
If it is the Worksheet Menu Bar then this will not work Look for a code examples on this page http://www.rondebruin.nl/menuid.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ups.com... Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Ron, Thank you for your response. I followed your suggestion however, I'm using ThisWorkbook.Commandbars.FindControl(ID:=300002).E nabled = False just to see how it works but I get error message: Object variable or With block variable not set - error code 91 Any advice? Thank you. amit Ron de Bruin wrote: Hi Amit If it is the Worksheet Menu Bar then this will not work Look for a code examples on this page http://www.rondebruin.nl/menuid.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ups.com... Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Amit
To many zero's Use 30002 to test But you must use the name Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Enabled = False -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message oups.com... Hello Ron, Thank you for your response. I followed your suggestion however, I'm using ThisWorkbook.Commandbars.FindControl(ID:=300002).E nabled = False just to see how it works but I get error message: Object variable or With block variable not set - error code 91 Any advice? Thank you. amit Ron de Bruin wrote: Hi Amit If it is the Worksheet Menu Bar then this will not work Look for a code examples on this page http://www.rondebruin.nl/menuid.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ups.com... Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I already had used the name but it didn't work! one thing is that I'm trying to hide or disable the "My Menu" not sub-items. Ron de Bruin wrote: Hi Amit To many zero's Use 30002 to test But you must use the name Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Enabled = False -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message oups.com... Hello Ron, Thank you for your response. I followed your suggestion however, I'm using ThisWorkbook.Commandbars.FindControl(ID:=300002).E nabled = False just to see how it works but I get error message: Object variable or With block variable not set - error code 91 Any advice? Thank you. amit Ron de Bruin wrote: Hi Amit If it is the Worksheet Menu Bar then this will not work Look for a code examples on this page http://www.rondebruin.nl/menuid.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ups.com... Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where is "My Menu" ?
In the same row as File, Edit, .................. -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ps.com... I already had used the name but it didn't work! one thing is that I'm trying to hide or disable the "My Menu" not sub-items. Ron de Bruin wrote: Hi Amit To many zero's Use 30002 to test But you must use the name Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Enabled = False -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message oups.com... Hello Ron, Thank you for your response. I followed your suggestion however, I'm using ThisWorkbook.Commandbars.FindControl(ID:=300002).E nabled = False just to see how it works but I get error message: Object variable or With block variable not set - error code 91 Any advice? Thank you. amit Ron de Bruin wrote: Hi Amit If it is the Worksheet Menu Bar then this will not work Look for a code examples on this page http://www.rondebruin.nl/menuid.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amit" wrote in message ups.com... Hello group, I'm trying to hide a user-defined menu item in Menu bar during following event: Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) Application.Commandbar("My Menu").Visible = False End Sub Which causes run time error '91' or "Object variable or With block variable not set" Does anybody know how can fix this? Your help will be appreciated. Thanks, akohan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Menu problem | Excel Programming | |||
PRoblem with Menu Set up | Excel Programming | |||
Excel Menu Problem | Excel Discussion (Misc queries) | |||
MENU Problem | Excel Programming | |||
MENU Problem | Excel Programming |