Solved

How can I reset Excel defaults for next workbook ?

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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 …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video shows where to find the word count, how to display it, and what it breaks down to in 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 …

772 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