Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong?
I have the following code that will disable the File \ Save As function on
the tool bar: Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=748, Recursive:=True).Enabled = False End Sub The problem is when I close this workbook and open a different one, my File \ Save As is disabled there also. I thought the VBA code would only impact the workbook in which it was written. What am I missing? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong?
Nothing. Commandbars are en Excel setting, not a workbook setting. You need
to restore the functionality. Maybe just put the Enabled back to true on the Workbook_BeforeClose event. "TimN" wrote: I have the following code that will disable the File \ Save As function on the tool bar: Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=748, Recursive:=True).Enabled = False End Sub The problem is when I close this workbook and open a different one, my File \ Save As is disabled there also. I thought the VBA code would only impact the workbook in which it was written. What am I missing? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong?
No. Changes to menus/commandbars are application changes.
-- Regards, Tom Ogilvy "TimN" wrote: I have the following code that will disable the File \ Save As function on the tool bar: Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=748, Recursive:=True).Enabled = False End Sub The problem is when I close this workbook and open a different one, my File \ Save As is disabled there also. I thought the VBA code would only impact the workbook in which it was written. What am I missing? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
i did something wrong | Excel Discussion (Misc queries) | |||
Min Max What's Wrong? | Excel Worksheet Functions | |||
Getting wrong value due to ref? | Excel Discussion (Misc queries) | |||
what am i doing wrong | Excel Programming |