View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Umlas, Excel MVP Bob Umlas, Excel MVP is offline
external usenet poster
 
Posts: 320
Default 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?