[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

How can I reset Excel defaults for next workbook ?

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
ksander
Asked:
ksander
  • 3
  • 2
1 Solution
 
starlCommented:
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
 
starlCommented:
for example - to set you two bars back on, the lines would be:

    Application.DisplayFormulaBar = True
    Application.DisplayStatusBar = True
0
 
ksanderAuthor Commented:
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
 
starlCommented:
try this:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
End Sub
0
 
ksanderAuthor Commented:
That did the trick - thanks very much
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now