Workbook_Close Q

S

Sean

I have the following code within ThisWorkbook which I wanted to use to
Display the formula bar when a particular file is closed. I don't want
the formula bar shown when this file is open, but do for my other
files and I have a Application.DisplayFormulaBar = False line in a
Workbook_Open sub. Problem being is on close it doesn't display the
formula bar, why is that?

Private Sub Workbook_close()
Application.DisplayFormulaBar = True

End Sub
 
P

paul.robinson

Hi
Should that be Workbook_BeforeClose(Cancel as Boolean)?

Is workbook_close allowed (or still allowed?)
regards
Paul
 
S

Sean

Hi
Should that be Workbook_BeforeClose(Cancel as Boolean)?

Is workbook_close allowed (or still allowed?)
regards
Paul





- Show quoted text -

I'm not sure Paul, but your suggestion works wonderfully

Thanks
 
G

Guest

You are correct in suggesting the code be in ThisWorkbook, and the OP use
the Workbook_BeforeClose event.

Alternatively, it could be done in a standard module using a sub named
Auto_Close. Similarly, Auto_open could be used instead of the Workbook_Open
event. This would obviate any issues resulting from a corrupt workbook, which
is not uncommon.

Regards,
Garry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Workbook_close 1
Formula Bar Hidden 6
Hide Excel Ribbon 2007 11
Hide the close X in excel 2
RunWhen error 4
Code Stopped 1
Closing application problem 2
Close help 2

Top