Microsoft KB Archive/152821

= Unable to Hide Full Screen Toolbar Through a Procedure =

Article ID: 152821

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95a

-



This article was previously published under Q152821



SYMPTOMS
In the versions of Microsoft Excel listed above, the Full Screen toolbar may stay visible in Full Screen mode, even though you are correctly using macro code to hide it.



CAUSE
This usually happens if Microsoft Excel is switched to full screen display through Microsoft Excel macro code and an attempt to hide the Full Screen toolbar occurs in the same macro. Any change to the Full Screen toolbar visibility state during a macro that switches full screen state may not work.



WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Use the OnTime method to call a second procedure that will set the visible property of the Full Screen toolbar to FALSE. The following example shows you how to create such a procedure. >

To Run the Macro
 On the Insert menu, point to Macro, and then click Module.  In the new module, enter the following: ' This macro is the main macro to run that will switch to full screen ' and will, in return, run the next procedure to hide the Full Screen ' toolbar. Sub Full_Screen ' Set Microsoft Excel to Full Screen Display. Application.DisplayFullScreen=True ' Immediately run the macro, Set_Toolbar. Application.OnTime Now, "Set_Toolbar" End Sub

' This macro should not be run directly, but will be run from the ' above procedure to hide the Full Screen toolbar while in Full ' Screen display mode. Sub Set_Toolbar ' Hide the Full Screen toolbar. Toolbars("Full Screen").Visible = False End Sub  On the Tools menu, click Macro. In the Macro dialog box, click Full_Screen i the list of Macro names, and then click Run.

The Full_Screen macro will set the display of Microsoft Excel to Full Screen mode and will, in return, run the procedure, Set_Toolbar, to hide the Full Screen toolbar.



STATUS
Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition.



MORE INFORMATION
Full-screen mode maximizes the application window to cover the entire screen and hides the application title bar (in Microsoft Windows). Toolbars, the status bar, and the formula bar maintain separate display settings for full-screen and normal mode. You can set or return the Full Screen status by using the Visual Basic for Applications property, DisplayFullScreen. The DisplayFullScreen property equals True if Microsoft Excel is in full-screen mode.

The Visible property for the Toolbar object will allow you to set or return the visibility of any Microsoft Excel toolbar. If the toolbar is visible the visible property is TRUE; if the toolbar is not visible the visible property is FALSE.

<div class="references_section">