Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anton - 15 Nov 2007 09:04 GMT
Hi All,

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

Best regards,
Anton
Anton - 15 Nov 2007 09:18 GMT
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?

> Hi All,
>
> How to edit other Word document during Word macro is running?
>
> Best regards,
> Anton
Jonathan West - 15 Nov 2007 12:45 GMT
>I use Word 2003.
>
[quoted text clipped - 5 lines]
> 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.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jörg - 19 Nov 2007 13:54 GMT
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.
fumei - 19 Nov 2007 16:33 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.