Modeless UserForm

pujo

Well-known Member
Joined
Feb 19, 2009
Messages
710
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Running some vba calcs on a worksheet, I have a userform with an image and label "Please Wait"

When executing the calcs subroutine, the userform is called but it takes a few saecond for the userform to show the image and label, the window window is visible.
I have the load statement before the show but still the same issue.

VBA Code:
Public Sub UserForm_Initialize()
    Load frmWait
    frmWait.Show vbModeless
End Sub

Is there a method of waiting for the "Load" state of the userform before showing?

Similar to the method of the calculation state?
If Not Application.CalculationState = xlDone Then DoEvents

I have looked on the web but haven't found anything pertaining to the state of a userform.

Thanks!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Instead of using another userform, would it be feasible to use a "Please Wait" label over the main userform? The label could be positioned out of the main UF window and when needed, its Left property appropriately set so that it's viewable. Or, the visible property could be set to False on UF initialize and then changed to True when needed.

Just a thought about avoiding using another UF.
 
Upvote 0
Thanks for the reply,
What I ended up doing was adding a wait time of 1 sec and all worked fine.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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