What am I doing wrong?

G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top