Word gradually slows down and dies during a Long iterative VBA pro

S

Steven S. Silver

I have a complex VBA application that creates many word documents over a
period of hours. Word leaves behind many locked tmp files that gradually
slow down processing until the system locks up. When word terminates these
files are still locked and not deleted or deletablee. What is the solution
aside from rebooting the computer. Even better how can I delete these file
from with my VBA Program - right now I get a 75 error "file locked" if I try
to delete any of them. Word 2003
 
J

Jean-Guy Marcil

Steven S. Silver said:
I have a complex VBA application that creates many word documents over a
period of hours. Word leaves behind many locked tmp files that gradually
slow down processing until the system locks up. When word terminates these
files are still locked and not deleted or deletablee. What is the solution
aside from rebooting the computer. Even better how can I delete these file
from with my VBA Program - right now I get a 75 error "file locked" if I try
to delete any of them. Word 2003

I would port the code to an external VB application.

This way, the code can run without Word being opened. So, once in a while
(After creating each file?), you can close Word in order to get rid of those
temp files before re-launching Word.
 
S

Steven S. Silver

This is a fair solution and would certainly work better than what I have now.
For various reasons it would be better if I could some how delete these tmp
files or keep them from beng created in the first place. Is this feasible
(even if difficult)?
 
K

Klaus Linke

Hi Steven,

I guess the code mangles the documents quite a bit? It might help if you
drop a few "ActiveDocument.UndoClear" in the code.

A lot of temp files are only created so that Word can undo any changes. In
your automated processing, there's really no need for that...

Regards,
Klaus
 

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