# VBForums CodeBank > CodeBank - Other >  Creating Splash Screen in MS Office 2003

## Siddharth Rout

Now you can create your own splash screens in MS Office 2003. I have shown an example in Excel. This can be modified slightly to work in MS-Word, MS-Powerpoint etc...

Create a userform. Name it say "frmSplash"

In the userform code window, paste this code



```
'Set this to true to close the form
Public CloseMe As Boolean

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    Cancel = Not CloseMe
End Sub
```

I have used a button to start the flash, You can use a sub and call it form the button or even put it in the Workbook open event...



```
Sub KoolSplash()
    Dim frm As frmSplash
    Dim i As Integer
    Dim j As Double

    '-- Deactivate Keyboard.
    Application.OnKey "^d", "KeyboardOn"
    Application.DataEntryMode = True

    '-- Display the Splash Form
    Set frm = New frmSplash
    frm.CloseMe = False
    frm.KoolPrgBar.Value = 0 '-- KoolPrgBar is the progressbar
    frm.Show False '-- Non Modal

    '-- Perform your task here while splash is shown.
    For i = 0 To 100 Step 10
        frm.KoolPrgBar.Value = i

        '-- Example -> I am killing time here... lol
        'Replace it with your code
        For j = 1 To 100000
            DoEvents
        Next j
    Next i

    '-- Close the Splash Form.
    frm.CloseMe = True
    Unload frm

    '-- Re-Activate keyboard.
    Application.DataEntryMode = False
End Sub
```

Project Attached...

----------


## RobDog888

Good work there Sid but since you are using the VB6 progresbar you may want to mention that systems without the microsoft common controls will need to have the vb6 redistributables installed on it  :Smilie:

----------


## Siddharth Rout

Good point Rob.

Here is another example of creating a splash screen using Animation and The Timer API

Please unzip all the files in C:\temp before running.

Edit: I have used two images. If you want you can use more than that. Simply name the images 0.Gif, 1.Gif, 2.Gif and so on... Then Change the code in module to


vb Code:
Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
    '~~> You can use bmp, gif etc...
    UserForm1.Image1.Picture = LoadPicture("C:\temp\" & Counter & ".bmp")
    Counter = Counter + 1
    If Counter = 10 Then
        EndTimer
        Unload UserForm1
    End If
End Sub

----------


## Siddharth Rout

Here is another example to create a splash screen like vb6 in vba

Using a Borderless form to achieve what you want....

The splash will autoclose in approx 8 seconds....

----------


## hensucker

can you make this screen automatic?
so that when you open the excel document it will just appear?

----------


## Siddharth Rout

Hi hensucker

the answer to your question lies in the 1st post above.  :Wink: 




> I have used a button to start the flash, You can use a sub and call it from the button or even put it in the Workbook open event...

----------

