PDA

View Full Version : [SOLVED:] Small Delay when showing Form



fredlo2010
04-11-2014, 09:00 AM
Hi everyone,

I created a small user form ( very small: 2 labels, 2 checkboxes, 1 button) but every time I show it there is a small delay between showing the frame and the actual form contents, for about 3 seconds the user gets a windows frame filled with white. This is not a big deal but I would like to optimize it.

I have tried the following:

Loading the form when the workbook opens (then I will show it when needed)
Loading the form when the the first sub runs (then I will show it when needed)
Using repaint as soon as shows.
Enabling screeenupdating.


Any ideas on this?

This is the current code snippet:



Load frmType
frmType.Show
frmType.Repaint


Thanks a lot for the help :)

Jan Karel Pieterse
04-11-2014, 10:36 AM
Can you attach the file (with just the form if needed) perhaps?

fredlo2010
04-11-2014, 10:42 AM
Unfortunately I cannot attach the file. Now that you mention it its worth noting that the form is in addin on a server location.

Thanks

Ago
04-11-2014, 11:02 AM
Have you tried to host the addin locally? Does that make any difference?


Is the addin loaded from start or is it called when the userform is needed?

fredlo2010
04-11-2014, 03:08 PM
Hosting the addin locally its not an option.

The addin is the first thing to kick in when the workbook opens; all the code is in the add in. The actually workbook just calls the addin procedures.

SamT
04-11-2014, 03:30 PM
:dunno Get the form into local memory first

Dim SubstituteForm As Object
Set SubstituteForm = Server.Addin.frmType
Load Substitute Form


SubstituteForm.Show

GTO
04-11-2014, 05:17 PM
Probably nothing, and please do not let this distract from more focusing on more likely culprits. Do you happen to be running WIN7? If yes, would it be easy (nearby workstation perhaps) that you could try in XP?

Mark

Ago
04-12-2014, 12:14 AM
Hosting the addin locally its not an option.

The addin is the first thing to kick in when the workbook opens; all the code is in the add in. The actually workbook just calls the addin procedures.


I meant you could try to host it locally and see if the delay is still there.
If there is no delay when run locally, you have found the "problem".

Jan Karel Pieterse
04-12-2014, 06:07 AM
Is there any code that runs when the form is shown?
Have you tried cleaning the code?

fredlo2010
06-10-2014, 07:29 AM
This issue went away by itself or I might have done something without noticing.

I even forgot about it.

Thanks for all the help :)