Microsoft KB Archive/136222

= How to Use a Custom Dialog Box as a Startup Screen =

Article ID: 136222

Article Last Modified on 10/10/2006

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0c
 * Microsoft Excel 5.0 Standard Edition

-



This article was previously published under Q136222





SUMMARY
In Microsoft Excel, it is possible to use a custom dialog box and a Visual Basic, Applications Edition, procedure together to create a startup (or "splash") screen.



MORE INFORMATION
A splash screen is a dialog box that is shown on the screen for a specified amount of time. When the specified amount of time has elapsed, the dialog box is hidden without any user interaction.

Visual Basic Code Example
Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

The following Visual Basic code will show a custom dialog box and hide the dialog box after 5 seconds have elapsed. If you want the dialog box to be displayed for more than 5 seconds, change the time that is specified in the macro.

This example assumes that you have created a custom dialog box named "Dialog1."

To run the example, position the insertion point in the "Sub ShowDialog" line and press F5. ' Sub ShowDialog DialogSheets("Dialog1").Show End Sub

'Attach this to the frame of the dialog box. Sub OnShow Application.SendKeys "~" MsgBox "This will not be displayed." Application.Wait Now + TimeValue("00:00:05") DialogSheets("Dialog1").Hide End Sub ' NOTE: To attach a macro to the frame of a dialog box, follow one of the procedures below.
 * Click once on the dialog box so that the frame of the dialog is selected. You will know that it is selected when you see the handles displayed around the edges of the dialog box. Once the dialog box is selected, choose Assign Macro from the Tools menu. From the list of macros, choose the macro to be assigned to the frame of the dialog and click OK. -or-


 * With the right mouse button, click the frame of the dialog box. On the shortcut menu, click Assign Macro. From the list of macros, select the macro to be assigned to the frame of the dialog box and click OK.

Additional query words: splash Excel

Keywords: kbprogramming KB136222

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.