Solved

How can I reset Excel defaults for next workbook ?

Posted on 2001-08-10
5
376 Views
Last Modified: 2012-06-27
We have a "Private Sub Workbook_Open()" macro that starts when a particular workbook opens and, among other things, hides the Formula Bar, Status Bar, and changes other settings for security and cosmetic reasons.

It work fine, but it leaves the Excel display defaults for other workbooks with the Formula Bar hidden and other setting modified - which we don't want.

Is there way to have something like a Workbook_Close macro to unhide the Formula Bar and restore the settings ?

Or another way ?

Anyhelp would be appreciated.
0
Comment
Question by:ksander
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:starl
ID: 6372919
the absolute easist way to get the macro (then put it under a Workbook_BeforeClose) would be to record your actions of setting things back right.
0
 
LVL 8

Expert Comment

by:starl
ID: 6372924
for example - to set you two bars back on, the lines would be:

    Application.DisplayFormulaBar = True
    Application.DisplayStatusBar = True
0
 

Author Comment

by:ksander
ID: 6373342
I'm doing something wrong. I created the following:

Private Sub Workbook_BeforeClose()
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
End Sub

It does get invoked when I close, but I get a Compile error message:

"Event procedure declaration does not match description of event having same name."
0
 
LVL 8

Accepted Solution

by:
starl earned 100 total points
ID: 6373665
try this:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
End Sub
0
 

Author Comment

by:ksander
ID: 6373927
That did the trick - thanks very much
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now