Solved

How can I reset Excel defaults for next workbook ?

Posted on 2001-08-10
5
377 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some time ago I was asked to create a VBA function that would calculate a check digit for an input number, using the following procedure: First, sum up all the individual digits in the number If that sum value has more than one digit, then sum up …
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

920 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

19 Experts available now in Live!

Get 1:1 Help Now