L
Lisa
Hi
I am using the following to disable all command bars when opening up my
worksheet within the Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB
End Sub
And setting it to True when I close the workbook within Private Sub
Workbook_BeforeClose(Cancel As Boolean).
I then wanted to enable my custom toolbar when all the others are disabled,
but I get an error. So to get around this, I used
Application.CommandBars(" comand bar name ").Enabled = True/False to switch
off and switch back on what I wanted
The problem is, I also use SaveCopyAs to give the worksheets a unique name
when they are saved. When they close, the beforeclose event kicks in and my
original workbook remains there with all toolbars visible.
Can anyone help?
I am using the following to disable all command bars when opening up my
worksheet within the Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB
End Sub
And setting it to True when I close the workbook within Private Sub
Workbook_BeforeClose(Cancel As Boolean).
I then wanted to enable my custom toolbar when all the others are disabled,
but I get an error. So to get around this, I used
Application.CommandBars(" comand bar name ").Enabled = True/False to switch
off and switch back on what I wanted
The problem is, I also use SaveCopyAs to give the worksheets a unique name
when they are saved. When they close, the beforeclose event kicks in and my
original workbook remains there with all toolbars visible.
Can anyone help?