2 Attachment(s)
Creating Splash Screen in MS Office 2003
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
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...
Code:
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...
Re: Creating Splash Screen in MS Office 2003
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 :)
2 Attachment(s)
Re: Creating Splash Screen in MS Office 2003
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
2 Attachment(s)
Re: Creating Splash Screen in MS Office 2003
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....
Re: Creating Splash Screen in MS Office 2003
can you make this screen automatic?
so that when you open the excel document it will just appear?
Re: Creating Splash Screen in MS Office 2003
Hi hensucker
the answer to your question lies in the 1st post above. ;)
Quote:
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...