ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing Code (https://www.excelbanter.com/excel-programming/350395-closing-code.html)

Brian Matlack[_45_]

Closing Code
 

Hi!
I have this code in my ThisWoekbook objects to reset the Excel
aplication before closing. It all seems to work except I do not get the
formula bar displayed as I want.
Why doesn't this code display the formula bar?
[start code]
Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
ActiveWorkbook.Save
ActiveWorkbook.Saved = True
With ActiveWindow
..DisplayHeadings = True
..DisplayOutline = True
..DisplayWorkbookTabs = True
End With
ActiveWindow.DisplayWorkbookTabs = True
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Drawing").Visible = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Warranty").Delete
Application.ScreenUpdating = True
End Sub
[end code]
As always any help is greatly appreciated.


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=501214



All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com