XL98: How to Create a Startup Screen with a UserForm

ID: Q185162

The information in this article applies to:

SUMMARY

In Microsoft Excel 98, you can use a custom UserForm and a Visual Basic for Applications macro to create a startup screen (splash screen). This article describes how to create a custom splash screen for a specific workbook.

MORE INFORMATION

Microsoft provides programming examples 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 article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/

A splash screen is a screen that is displayed for a designated amount of time when you start a program. You can create a UserForm and run a macro to simulate a splash screen. After a specified amount of time elapses, the macro hides the dialog box without any user interaction. To create a sample splash screen, use the following steps.

Create a Workbook_Open Macro

1. Save and close any open workbooks, and then create a new workbook.

2. With the workbook active, start the Visual Basic Editor (press

   OPTION+F11).

3. Click Project Explorer on the View menu to display the Project Explorer
   window.

4. In the Project Explorer window, double-click ThisWorkbook in the
   current project.

5. In the Object drop-down, click Workbook.

6. Enter the code so that the Workbook_Open procedure resembles the

   following:

      Private Sub Workbook_Open()

        UserForm1.Show ' Show the form each time the workbook is opened

      End Sub

Create a Form and a Userform_Activate Macro

1. Click UserForm on the Insert menu.

2. Double-click the UserForm.

3. In the Procedure drop-down, click Activate.

4. Enter the code so that the UserForm_Activate procedure resembles the

   following:

      Private Sub UserForm_Activate()

        Application.Wait Now + TimeValue("00:00:05") ' Wait 5 seconds
        UserForm1.Hide                               ' Hide the form

      End Sub

5. Click Microsoft Excel on the View menu, and then save and close the
   workbook.

When you reopen the workbook, the form will appear for 5 seconds, and then disappear.

Additional query words: dialog XL98

Keywords          : kbprg kbdta EPUCon KbVBA 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbhowto

Last Reviewed: May 18, 1999