Workbook_close

M

Martin

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
 
J

JLGWhiz

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.
 

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


Top