Long running macro and screen update

J

James

I am having a similar problem here. I created a long running macro, and
would like the user to be able to navigate around the workbook while the
macro is running. In the mean time, I popup a modeless dialog to keep the
user inform regarding the process. I face two problems:

1. Excel stop responding to input while the macro is running. I can't
navigate the workbook.
2. My modeless dialog box doesn't repaint until the macro is done.

Both problem originate from which Excel did not handle window messages while
the macro is running. I tried to peek into the message loop to process the
message, but that doesn't help either.

Anybody has a solution to this?


James.
 
J

James

Good Call. It works!!! Thanks a lot.

That raise another problem. The DoEvents causes excessive flickering on the
UI...
 
H

hooksie2

I may be completely off track but often flickering is caused if you are
selecting cells, sheets etc rather than accessing their values
directly.

If you're not doing that another idea would be try
Application.ScreenUpdating = False (then set it to true when you're
finished)
 
H

hooksie2

I may be completely off track but often flickering is caused if you are
selecting cells, sheets etc rather than accessing their values
directly.

If you're not doing that another idea would be try
Application.ScreenUpdating = False (then set it to true when you're
finished)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top