Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VB code changed Excel settings for all worksheets

I used the following vb code in a file to disable a the menu items. Now
every time I open Excel the Menu is not there.
Green around the gills with vb. What did I do wrong?

Application.CommandBars.("Worksheet Menu Bar").Enabled = False
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VB code changed Excel settings for all worksheets

Hi JenniferMc

Open Excel
Alt-F11
Insert module
Paste the sub
Alt-Q

Alt-F8
Select test
Run

Sub test()
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JenniferMc" wrote in message ...
I used the following vb code in a file to disable a the menu items. Now
every time I open Excel the Menu is not there.
Green around the gills with vb. What did I do wrong?

Application.CommandBars.("Worksheet Menu Bar").Enabled = False



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VB code changed Excel settings for all worksheets

Can this code run when the document is closed so that only the specific
workbook is impacted?

"Ron de Bruin" wrote:

Hi JenniferMc

Open Excel
Alt-F11
Insert module
Paste the sub
Alt-Q

Alt-F8
Select test
Run

Sub test()
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JenniferMc" wrote in message ...
I used the following vb code in a file to disable a the menu items. Now
every time I open Excel the Menu is not there.
Green around the gills with vb. What did I do wrong?

Application.CommandBars.("Worksheet Menu Bar").Enabled = False




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VB code changed Excel settings for all worksheets

Sure

Use this events in the thisworkbook module

Private Sub Workbook_Activate()
Application.CommandBars("Worksheet Menu Bar").Enabled = False
End Sub

Private Sub Workbook_Deactivate()
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"JenniferMc" wrote in message ...
Can this code run when the document is closed so that only the specific
workbook is impacted?

"Ron de Bruin" wrote:

Hi JenniferMc

Open Excel
Alt-F11
Insert module
Paste the sub
Alt-Q

Alt-F8
Select test
Run

Sub test()
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JenniferMc" wrote in message ...
I used the following vb code in a file to disable a the menu items. Now
every time I open Excel the Menu is not there.
Green around the gills with vb. What did I do wrong?

Application.CommandBars.("Worksheet Menu Bar").Enabled = False






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default VB code changed Excel settings for all worksheets



"JenniferMc" wrote:

I used the following vb code in a file to disable a the menu items. Now
every time I open Excel the Menu is not there.
Green around the gills with vb. What did I do wrong?

Application.CommandBars.("Worksheet Menu Bar").Enabled = False


I learned the hard way that those code lines become the ongoing defaults for
Excel. I cured it by running a macro wherein the codes end in "=True". The
problem is that any users that you gave your macros to now have the same
problem of a missing menu. You'll have to send them the repair macro.

Regards
Paul




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
my excel settings changed and i have only 1 instance running. Melissa Setting up and Configuration of Excel 1 March 28th 10 04:30 AM
Charts: Can the Default settings be changed jimbo Charts and Charting in Excel 1 July 24th 07 02:37 PM
Can AutoSave's default settings be changed to one's preference? SoNearRedmondICouldThrowWaterBombsAtThem Excel Discussion (Misc queries) 3 August 18th 06 11:42 PM
Settings are changed when opening workbook on a different computer J Excel Discussion (Misc queries) 1 March 31st 06 06:11 PM
Restoring Excel menu bar settings that were changed by code Jon Peltier[_3_] Excel Programming 5 August 4th 03 09:38 PM


All times are GMT +1. The time now is 04:48 PM.

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

About Us

"It's about Microsoft Excel"