How to edit other Word document during Word macro is running?

A

Anton

Hi All,

How to edit other Word document during Word macro is running?

Best regards,
Anton
 
A

Anton

I use Word 2003.

I am creating very big Word document(500 pages) using VBA macro. It takes
some minutes.
Macro uses 100% CPU in Normal prority for the Word process.
I can not open and edit other Word document in that time.
Can macro work in one process with changing document and I change other word
document in other process in the same time?
 
J

Jonathan West

Anton said:
I use Word 2003.

I am creating very big Word document(500 pages) using VBA macro. It takes
some minutes.
Macro uses 100% CPU in Normal prority for the Word process.
I can not open and edit other Word document in that time.
Can macro work in one process with changing document and I change other
word
document in other process in the same time?


Short answer - No. Go and get a cup of coffee while the macro is running.

Longer answer. In theory yes, but I really wouldn't recommend it. You would
have to have designed your macro to make no use of Selection, Select,
ActiveDocument, Copy, Paste, PasteSpecial or PasteAndformat (and probably
some others that I have missed) otherwise manually switching to another
document and editing it will mess up the running of the macro. I suggest you
don't even try. If you need to be getting on with other work in the
meantime, the best approach is to get a second PC.
 
J

Jörg

To increase performance of other programms running in the background you can
insert a call to DoEvents in your loops. This may also increase performance
of your own word programm, because background jobs (like garbage collection)
are done.
 
F

fumei via OfficeKB.com

I like both answers that have been given.

1. Yes, yes, yes. It depends on what your macro is doing, and how it is
doing it. We have no idea what it is doing, or how it is doing it. If there
are lots of loops, and it uses Selection for the work, then it may very well
be possible to speed up the macro itself.

2. DoEvents could be a viable option, especially if it seems to be using 100%
CPU.
 

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