Workbook_Close Q

  • Thread starter Thread starter Sean
  • Start date Start date
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
 
Hi
Should that be Workbook_BeforeClose(Cancel as Boolean)?

Is workbook_close allowed (or still allowed?)
regards
Paul
 
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
 
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
 
Back
Top