Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Help with DoEvents to show progress form, please?

I've got a pretty long-running macro inside a UserForm, and I wanted
to open a second form just to show that things are still working and
not crashed. It's pretty simple - four labels and I cycle around
turning one at a time a different color.

I call it from the main form with
Private Sub CommandButton1_Click()

DoEvents
frmWaiting.Show vbModeless
DoEvents

Unfortunately, once the code drops into the second form, the main code
in the first form never executes.

I thought DoEvents was supposed to let the running code "drop through"
to allow both forms to run their code. Obviously, I'm very
incorrect!! 8(

How can I make this happen correctly?
Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Help with DoEvents to show progress form, please?

Hi,

this won't work that way. What you can do is put the long running code in a
separate Sub or Function and when you open the second form, have that form
call the code in the separate Sub. Inside the separate sub, you then need
to add the code to change the color in you second form.

Sounds more complicated than it actually is.

rgds,
Carl

Ed from AZ wrote in news:48ac5d93-0de6-4031-b1e4-
:

I've got a pretty long-running macro inside a UserForm, and I wanted
to open a second form just to show that things are still working and
not crashed. It's pretty simple - four labels and I cycle around
turning one at a time a different color.

I call it from the main form with
Private Sub CommandButton1_Click()

DoEvents
frmWaiting.Show vbModeless
DoEvents

Unfortunately, once the code drops into the second form, the main code
in the first form never executes.

I thought DoEvents was supposed to let the running code "drop through"
to allow both forms to run their code. Obviously, I'm very
incorrect!! 8(

How can I make this happen correctly?
Ed


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
show download progress to user VBANovice Excel Programming 1 March 18th 10 08:23 PM
Show progress of copying Joe[_46_] Excel Programming 1 November 19th 07 09:09 PM
Show an ODBC progress Jonathan Excel Programming 1 October 25th 05 04:44 PM
Show progress in a user form while code runs Bura Tino Excel Programming 2 April 15th 04 06:18 AM


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"