Solved

How can I reset Excel defaults for next workbook ?

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

838 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