Progress bar form

iabbott
02-09-2011, 01:23 AM
I am trying to make a form that will display the progress of my macro as a bar on a form

Trouble is, when I run the macro, the form appears, but as just a white box with the blue border, my message and progress bar are not displayed..

If I use ctrl + Pause to halt the macro, the form displays properly, but when I then resume the code, it either freezes at it's current position or goes white again

I am checking through about 11,000 rows of data, so although it works fine if I put in an Application.Wait for 1 second, it is not practical to have there (my code takes about 25 seconds to run through, 11,000 seconds is a few too many :P )

Is there another way I can make the form update? I tried turning Screen Updating on before the line of code to increase the length of the progress bar, but this didn't work either. Also, as the Application.Wait command only works with a minimum of 1 second, I cant put in 0.1 instead :(

JONvdHeyden
02-09-2011, 01:29 AM
Look at Sleep API as a substitute to the Wait method.

Also, hard to tell without seeing the code. Is the form modal or modeless? I think turning off screen updating may well be a culprit here. Perhaps there are intervals where you need to repaint the form?

Like I say, hard to make suggestions without seeing the code.

Colin Legg
02-09-2011, 02:06 AM
Use the userform's Repaint method to ensure it displays correctly.

iabbott
02-09-2011, 02:15 AM
Use the userform's Repaint method to ensure it displays correctly.

Didn't know about that function, it now works fine :)

Thanks for the replies

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum