PermaNoob
PermaNoob

Reputation: 869

DisplayFullScreen and DisplayFormulaBar Not Playing Well Together

I was making an application and I went to hide the formula bar and make it full screen in my Workbook_Activate event, then show the formula bar and make it windowed(is that a word?) in my Workbook_Deactivate event. I actually struggled with this for a while. I kept having a problem with the formula bar showing up when it wasn't supposed to or disappearing when I wanted it there. I finally got it to work by making sure I used the DisplayFullScreen first and only then using the DisplayFormulaBar method.

Does anyone know why you would need to put these in a specific order for them to work together? I couldn't find anything when I was looking for it.

I'm using Excel 2010.

EDIT: Here's my code.

Private Sub Workbook_Activate()
    Application.ScreenUpdating = False

    ThisWorkbook.Sheets(2).Activate
    ActiveWindow.DisplayGridlines = False
    ActiveWindow.DisplayHeadings = False

    ThisWorkbook.Sheets(1).Activate
    ActiveWindow.DisplayGridlines = False
    ActiveWindow.DisplayHeadings = False

    Application.DisplayFullScreen = True
    Application.DisplayFormulaBar = False

    Application.ScreenUpdating = True
End Sub

Private Sub Workbook_Deactivate()
    Application.DisplayFullScreen = False
    Application.DisplayFormulaBar = True
End Sub

Upvotes: 2

Views: 1900

Answers (1)

PermaNoob
PermaNoob

Reputation: 869

This is from the MSDN documentation: "Toolbars, the status bar, and the formula bar maintain separate display settings for full-screen mode and normal mode."

https://msdn.microsoft.com/en-us/library/office/ff838060.aspx

I was searching for mostly DisplayFormulaBar topics since that was what was showing up strangely for me. Hopefully this helps anyone who searches for it in the future.

Upvotes: 2

Related Questions