Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Workbook_close

Hi,

I have the code posted below that on the close workbook event it replaces
the toolbars, gridlines etc. that I remove on the workbook_open event.
However the only line that doesnt seem to work properly is the
"Application.DisplayFormulaBar = True".

When I close the workbook I never get my formula bar back and I have to go
to options to reset.

Can anyone help me in understanding why this is?

Many thanks in advance.

Martin

Here is the code:

Sub Workbook_close()

Sheets("Main Menu").Activate
With ActiveWindow
.DisplayGridlines = True
.DisplayHeadings = True
.DisplayWorkbookTabs = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With

Application.DisplayFormulaBar = True

Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Standard").Enabled = True
Application.CommandBars("Reviewing").Enabled = True
Application.CommandBars("Formatting").Enabled = True
Application.CommandBars("Drawing").Enabled = True
Application.CommandBars("Chart").Enabled = True
Application.CommandBars("Control Toolbox").Enabled = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Workbook_close

The only thing I can think of is timing. You might try a delay after or
before the execution line. Or, move that line to the beginning of the
macro.


"Martin" wrote in message
...
Hi,

I have the code posted below that on the close workbook event it replaces
the toolbars, gridlines etc. that I remove on the workbook_open event.
However the only line that doesnt seem to work properly is the
"Application.DisplayFormulaBar = True".

When I close the workbook I never get my formula bar back and I have to go
to options to reset.

Can anyone help me in understanding why this is?

Many thanks in advance.

Martin

Here is the code:

Sub Workbook_close()

Sheets("Main Menu").Activate
With ActiveWindow
.DisplayGridlines = True
.DisplayHeadings = True
.DisplayWorkbookTabs = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With

Application.DisplayFormulaBar = True

Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Standard").Enabled = True
Application.CommandBars("Reviewing").Enabled = True
Application.CommandBars("Formatting").Enabled = True
Application.CommandBars("Drawing").Enabled = True
Application.CommandBars("Chart").Enabled = True
Application.CommandBars("Control Toolbox").Enabled = True

End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook_Close Q Sean Excel Programming 2 March 23rd 07 09:04 AM
write WorkBook_close event dynamically kpriyac[_5_] Excel Programming 1 August 21st 06 08:45 PM


All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"