Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nrussell
 
Posts: n/a
Default help! How do I restore command bars?


Okay,

This may sound like a dumb question but how do I restore the command
bars in Excel. I've managed to delete them all while playing about with
the following code.

Each time I open Excel there is no longer any menus.
I'm in a right panic at this time

Sub Change_Cell_Menu()
Dim IDnum As Variant
Dim N As Integer
Dim Ctl As CommandBarControl

'Set Enabled to False for all the controls
For Each Ctl In CommandBars("Cell").controls
On Error Resume Next
Ctl.Enabled = False
On Error GoTo 0
Next Ctl
Sub Disable_Command_Bars_1()
'This will disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
End Sub

Any help is urgently needed.

-Joe


--
nrussell
------------------------------------------------------------------------
nrussell's Profile: http://www.excelforum.com/member.php...o&userid=23731
View this thread: http://www.excelforum.com/showthread...hreadid=374054

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

In the immediate window type

Application.Commandbars("Worksheet Menu Bar").Enabled = True

and then you can do ToolsCustomizeToolbars to get the rest back

--

HTH

RP
(remove nothere from the email address if mailing direct)


"nrussell" wrote in
message ...

Okay,

This may sound like a dumb question but how do I restore the command
bars in Excel. I've managed to delete them all while playing about with
the following code.

Each time I open Excel there is no longer any menus.
I'm in a right panic at this time

Sub Change_Cell_Menu()
Dim IDnum As Variant
Dim N As Integer
Dim Ctl As CommandBarControl

'Set Enabled to False for all the controls
For Each Ctl In CommandBars("Cell").controls
On Error Resume Next
Ctl.Enabled = False
On Error GoTo 0
Next Ctl
Sub Disable_Command_Bars_1()
'This will disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
End Sub

Any help is urgently needed.

-Joe


--
nrussell
------------------------------------------------------------------------
nrussell's Profile:

http://www.excelforum.com/member.php...o&userid=23731
View this thread: http://www.excelforum.com/showthread...hreadid=374054



  #3   Report Post  
dominicb
 
Posts: n/a
Default


Good evening Joe

Have you tried "reversing" your code (ie., change the Enabled=False to
Enabled=True) and rerunning it?

I try not to tinker with my toolbars too mch 'cos it's easy to get into
a pickle and the end result is a bit too permanent for my liking (but
that doesn't help you in this situation...)

Alternatively, try this code:

Sub ShowAll()
Dim UsrSht As Worksheet, UsrCell As Range
Set UsrSht = Sheets("UsrSht")
On Error Resume Next
For Each UsrCell In UsrSht.Range("A:A") _
.SpecialUsrCells(xlUsrCellTypeConstants)
CommandBars(UsrCell.Value).Visible = True
Next UsrCell
End Sub

...and if this doesn't work, you might have to reinstall.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=374054

  #4   Report Post  
Alan
 
Posts: n/a
Default

"nrussell"
wrote in message news:nrussell.1plyn9_1117059011.0078@excelforum

Okay,

This may sound like a dumb question but how do I restore the

command
bars in Excel. I've managed to delete them all while playing about
with
the following code.

Each time I open Excel there is no longer any menus.
I'm in a right panic at this time

Sub Change_Cell_Menu()
Dim IDnum As Variant
Dim N As Integer
Dim Ctl As CommandBarControl

'Set Enabled to False for all the controls
For Each Ctl In CommandBars("Cell").controls
On Error Resume Next
Ctl.Enabled = False
On Error GoTo 0
Next Ctl
Sub Disable_Command_Bars_1()
'This will disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
End Sub

Any help is urgently needed.

-Joe


--
nrussell
-------------------------------------------------------------------

-----
nrussell's Profile:
http://www.excelforum.com/member.php...o&userid=23731
View this thread:
http://www.excelforum.com/showthread...hreadid=374054




Hi,

This might do it, but use at your own risk!


Sub ResetAll ()

For Each MyBar in Application.Commandbars

MyBar.Enabled = True
MyBar.Reset

Next

End Sub




HTH,

Alan.


  #5   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi nrussell

I have this lines on my site to <g

Important !!!!!
All examples use Enabled = False to disable the control(s).
If you want to restore it change False to True in the code.



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



"nrussell" wrote in message
...

Okay,

This may sound like a dumb question but how do I restore the command
bars in Excel. I've managed to delete them all while playing about with
the following code.

Each time I open Excel there is no longer any menus.
I'm in a right panic at this time

Sub Change_Cell_Menu()
Dim IDnum As Variant
Dim N As Integer
Dim Ctl As CommandBarControl

'Set Enabled to False for all the controls
For Each Ctl In CommandBars("Cell").controls
On Error Resume Next
Ctl.Enabled = False
On Error GoTo 0
Next Ctl
Sub Disable_Command_Bars_1()
'This will disable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next
End Sub

Any help is urgently needed.

-Joe


--
nrussell
------------------------------------------------------------------------
nrussell's Profile: http://www.excelforum.com/member.php...o&userid=23731
View this thread: http://www.excelforum.com/showthread...hreadid=374054





  #6   Report Post  
nrussell
 
Posts: n/a
Default


Thanks for the ideas but none of them worked. I disabled Excel well and
good! In the end I had to reset my profile :(

That did teach me a very important lesson on how damaging Macros really
are. Never going to play about with that code again!

-Joe


--
nrussell
------------------------------------------------------------------------
nrussell's Profile: http://www.excelforum.com/member.php...o&userid=23731
View this thread: http://www.excelforum.com/showthread...hreadid=374054

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
restore the title bar in excel? dennis Excel Discussion (Misc queries) 4 June 2nd 05 11:26 PM
restore the title bar in excel? twodogsdennis Excel Discussion (Misc queries) 1 March 15th 05 02:01 PM
Restore a deleted document Restoring a document Excel Discussion (Misc queries) 2 January 21st 05 05:59 PM
How to add a button to restore all altered cells original values? Dawnybros Excel Discussion (Misc queries) 2 December 2nd 04 04:35 PM
How to restore menu bar in microsoft word? Vi Truong Excel Discussion (Misc queries) 1 November 30th 04 11:55 PM


All times are GMT +1. The time now is 05:25 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"