PDA

View Full Version : Solved: VBA Splash screen



tpoynton
11-25-2005, 05:35 PM
Greetings,

I have followed the directions at http://www.ozgrid.com/Excel/excel-splash-screen.htm to the letter for creating a splash screen; it works fine on the PC, but on a Mac (office 2004) the timer seems to fail; the splash screen appears, but I have to manually close it...no errors are present. any ideas?

PS - i also checked i the Mac help to make sure that the "now" part of the time function could be used...it is documented.

THANKS!

shades
11-25-2005, 06:10 PM
Can you post the exact code you are using at each step?

tpoynton
11-25-2005, 06:16 PM
OK -

here is what i have in ThisWorkbook

Private Sub Workbook_Open()
Splash.Show
End Sub


here's what i have in my only module

Sub KillForm()
Unload Splash
End Sub


here's what i have in the userform named Splash

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


THANKS!

BlueCactus
11-25-2005, 07:40 PM
After trying a few things, it looks like it might be a consequence of the non-support for non-modal forms in Mac Office. Once that form is open, no code executes until the form is closed. Stick a MsgBox in with your Unload - you'll see.

Not sure where to go with this. The obvious alternative - putting an Application.Wait followed by Unload Me into Userform_Initialize() doesn't work because you can't Unload before Initialize has completed.

BTW, I would bet that if you have a copy of Excel 97 lying around, you'd see the exact same problem there.

shades
11-25-2005, 09:26 PM
I found the same thing. VB 5 is behind XL 2004 and XL 97. I know that in helping another person last year convert UserForms, it was a pain to get them to work properly on the Mac.

tpoynton
11-26-2005, 06:57 AM
I have it working...for pc's, and set it not to show if the OS is Mac. I also put in an "on error resume next" just in case there are some Excel 97 users. This is a better solution than having no splash screen at all!

Thanks Shades and BlueCactus for investigating!