Excel Mac - Application.OnTime error

Seorch

New Member
Joined
May 4, 2012
Messages
3
Hi,

I'm about to create a splash screen for an Excel application. I've noticed many examples using "Application.OnTime" to close the splash screen after a few sec. I'm on a Mac (Excel 2011) and this solutions doesn't work. Is there another way of achieving this that works on both PC and Mac?

/Johan
www.seorch.me
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi and Welcome to MrExcel!
Have not MAC Excel, but hope this code works:
Rich (BB code):

' Code of UserForm which is used as Splash Screen
Private Sub UserForm_Activate()
  
  Const Delay = 2 ' <-- 2 seconds delay, change to suit
  
  Dim X As Single
  
  ' Charge the unload time X
  X = Timer + Delay
  
  ' Wait
  While Timer < X
    DoEvents
  Wend
  
  ' Unload UserForm
  Unload Me
  
End Sub
Regards,
 
Upvote 0
Hi,

Thanks for the code. Have not tried it out yet. Will do. The solution I came up with was using a "Do - Until" loop.

Code:
Private Sub UserForm_Activate()
    EndTime = Now + TimeValue("00:00:5")
    
    Do
    'Empty
    Loop Until (Now >= EndTime)
    Unload Me
End Sub

Don't know if this solution is good or bad, but it works. What do you think?
 
Upvote 0
Hi guys,

I've tried both of these, plus what works fine in my PC Excel 2010: Application.OnTime Now + TimeValue("00:00:05"), "KillForm", but nothing works on the Mac. The form appears upon open, but just won't close on any time interval.

Anybody have any other ideas?

Much appreciated,
Paul
 
Upvote 0

Forum statistics

Threads
1,216,342
Messages
6,130,114
Members
449,558
Latest member
andyamcconnell

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