Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
i did something wrong Roy Excel Discussion (Misc queries) 3 October 9th 06 10:45 PM
Min Max What's Wrong? shep Excel Worksheet Functions 4 October 4th 06 09:46 PM
Getting wrong value due to ref? jesmin Excel Discussion (Misc queries) 2 March 16th 06 02:12 AM
what am i doing wrong short_n_curly[_12_] Excel Programming 7 July 13th 05 06:34 PM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"