ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to de-activate Menu bar in only one Excel Workbook ????????/ (https://www.excelbanter.com/excel-programming/438719-how-de-activate-menu-bar-only-one-excel-workbook.html)

vicky

How to de-activate Menu bar in only one Excel Workbook ????????/
 
This code works fine . But the problem is i want to apply to only one
specific workbook . i.e this code it De-activates the Sheet menu bar
in all the excel files i open .....

How to de-activate Menu bar in only one Excel Workbook ????????/ Say i
want to Deactivate the Sheet toolbar in only Test.xls Workbook .

Private Sub Workbook_Open()

'Application.CommandBars.FindControl(ID:=30026).En abled = True
Dim Ctl As CommandBarControl
On Error Resume Next
For Each Ctl In Application.CommandBars.FindControl
(ID:=30026).Controls
Ctl.Enabled = False
Next Ctl
Application.CommandBars.FindControl(ID:=30006).Ena bled = True
On Error GoTo 0


End Sub

Barb Reinhardt

How to de-activate Menu bar in only one Excel Workbook ????????/
 
I've done it by modifying the ribbon controls for the workbook.

Read these articles and see if it helps


http://msdn.microsoft.com/en-us/library/dd756403.aspx
http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx
http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx

It's kind of complicated at first, but once you do it a couple of times, it
makes more sense. :)
--
HTH,

Barb Reinhardt



"vicky" wrote:

This code works fine . But the problem is i want to apply to only one
specific workbook . i.e this code it De-activates the Sheet menu bar
in all the excel files i open .....

How to de-activate Menu bar in only one Excel Workbook ????????/ Say i
want to Deactivate the Sheet toolbar in only Test.xls Workbook .

Private Sub Workbook_Open()

'Application.CommandBars.FindControl(ID:=30026).En abled = True
Dim Ctl As CommandBarControl
On Error Resume Next
For Each Ctl In Application.CommandBars.FindControl
(ID:=30026).Controls
Ctl.Enabled = False
Next Ctl
Application.CommandBars.FindControl(ID:=30006).Ena bled = True
On Error GoTo 0


End Sub
.



All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com