Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Works too well - Hide toolbar Macro

Hi,

I was given a macro on this forum to hide all the toolbars and menus. I
used it on the file I wanted and it works perfectly. The macro was entered
using the right click on the top left of the screen, not on the sheet tabs
section.

However now I've changed computers and I applied the macro again after
making some updates to the file, (i keep a master file without the macro on
my harddrive so that i can update and then add the macro before saving it for
general use), but this time it has hidden the menus on every excel file on my
computer - even new files that I open.

Now I am completely stuffed!

How can I
- stop this activating on all excel files?
- remove it from the file I want?

Thanks
LiAD

I have attached the macro I am using for reference.

Private mFormulaBar

Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Works too well - Hide toolbar Macro

In the immediate window in the VBIDE try

Application.CommandBars(1).Enabled=True

You should be able to use Customize to retrieve the reset then.

--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
Hi,

I was given a macro on this forum to hide all the toolbars and menus. I
used it on the file I wanted and it works perfectly. The macro was
entered
using the right click on the top left of the screen, not on the sheet tabs
section.

However now I've changed computers and I applied the macro again after
making some updates to the file, (i keep a master file without the macro
on
my harddrive so that i can update and then add the macro before saving it
for
general use), but this time it has hidden the menus on every excel file on
my
computer - even new files that I open.

Now I am completely stuffed!

How can I
- stop this activating on all excel files?
- remove it from the file I want?

Thanks
LiAD

I have attached the macro I am using for reference.

Private mFormulaBar

Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Works too well - Hide toolbar Macro

Its because:

"Private Sub Workbook_BeforeClosex() "

should have been :

Private Sub Workbook_BeforeClose()


LiAD wrote:

Hi,

I was given a macro on this forum to hide all the toolbars and menus. I
used it on the file I wanted and it works perfectly. The macro was entered
using the right click on the top left of the screen, not on the sheet tabs
section.

However now I've changed computers and I applied the macro again after
making some updates to the file, (i keep a master file without the macro on
my harddrive so that i can update and then add the macro before saving it for
general use), but this time it has hidden the menus on every excel file on my
computer - even new files that I open.

Now I am completely stuffed!

How can I
- stop this activating on all excel files?
- remove it from the file I want?

Thanks
LiAD

I have attached the macro I am using for reference.

Private mFormulaBar

Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Works too well - Hide toolbar Macro

Thanks.

This gets me the tool bars back but I still cannot right click on the top
left to re-insert theworkbook event code again.

Is it possible to retrieve this option?

Thanks

"Bob Phillips" wrote:

In the immediate window in the VBIDE try

Application.CommandBars(1).Enabled=True

You should be able to use Customize to retrieve the reset then.

--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
Hi,

I was given a macro on this forum to hide all the toolbars and menus. I
used it on the file I wanted and it works perfectly. The macro was
entered
using the right click on the top left of the screen, not on the sheet tabs
section.

However now I've changed computers and I applied the macro again after
making some updates to the file, (i keep a master file without the macro
on
my harddrive so that i can update and then add the macro before saving it
for
general use), but this time it has hidden the menus on every excel file on
my
computer - even new files that I open.

Now I am completely stuffed!

How can I
- stop this activating on all excel files?
- remove it from the file I want?

Thanks
LiAD

I have attached the macro I am using for reference.

Private mFormulaBar

Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Works too well - Hide toolbar Macro

Is this what has disabled all files and not just the one I wanted or does
this make it difficult to undo?

Thanks for your help

"dk" wrote:

Its because:

"Private Sub Workbook_BeforeClosex() "

should have been :

Private Sub Workbook_BeforeClose()


LiAD wrote:

Hi,

I was given a macro on this forum to hide all the toolbars and menus. I
used it on the file I wanted and it works perfectly. The macro was entered
using the right click on the top left of the screen, not on the sheet tabs
section.

However now I've changed computers and I applied the macro again after
making some updates to the file, (i keep a master file without the macro on
my harddrive so that i can update and then add the macro before saving it for
general use), but this time it has hidden the menus on every excel file on my
computer - even new files that I open.

Now I am completely stuffed!

How can I
- stop this activating on all excel files?
- remove it from the file I want?

Thanks
LiAD

I have attached the macro I am using for reference.

Private mFormulaBar

Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub


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
hide custom toolbar from Toolbar list tracktraining Excel Programming 3 February 26th 09 09:28 PM
Assigning macro to toolbar - only works sometimes! Zak Excel Worksheet Functions 4 January 30th 08 04:47 PM
toolbar/ribbon hide/show macro barrowhill Excel Programming 2 July 26th 07 07:56 PM
How do you add a-z (alphabetically) to your toolbar in micr works Granny Bev Excel Worksheet Functions 3 September 15th 05 10:04 AM
Hide Row macro works in 2002 but not 2003 Gooser555 Excel Programming 3 February 16th 05 10:17 PM


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