Splash screen that won't Unload

saltire1963

Board Regular
Joined
Aug 11, 2014
Messages
69
I've created a splash screen that opens when the workbook opens as planned, but does not unload after the required 3 seconds, it just stays open and does not seem to call the Sub that should close it. I'm using the code Application.OnTime Now + TimeValue("00:00:03"), "UnloadSplash" , and UnloadSplash is a Sub I have created in a general VBA module. Can anyone point me in the right direction or suggest what I can try to fix?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You might try only putting the code to show the splash screen in the Workbook Module and put your timer and unload commands in the userform module. You may have to create an additional unload sub in a code module which is called from the userform.
 
Upvote 0
Yes, that is what I have done, but it doesn't work. I have since tried changing the code in the userform module from Sub frmSplash_Initialize() to UserForm_Initialize() and it comes up with an error message saying"Cannot run the macro....... The macro may not be available in this workbook or all macros may be disabled" which I cannot explain
 
Upvote 0
We can't be talking about a lot of code here. Probably the best thing for you to do would be to post your code...
 
Upvote 0
OK, in ThisWorkbook module I have:Private Sub Workbook_Open()
frmSplash.Show
End Sub

In the UserForm module I have:

Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:00:03"), "UnloadSplash"
End Sub

In a general VBA module I have:
Sub UnloadSplash()
Unload frmSplash
End Sub
 
Upvote 0
I am glad it is working. I don't think I had anything to do with it, but either way, thanks for the feedback!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top