Repearted Document.Saveas gradually slows down

S

Steven S. Silver

I am using VBA in word 2003 to generated large numbers of reports with data
extracted from an Access database. Word was chosen as the platform since we
need its robust formatting features.
When the program starts I can generate reports at the rate of 1/per second.
After a number of reports (1000-3000) are generated the reports start taking
in excess of 6-10 seconds per report, each with nearly identical content.
Timing probes show the problem to be in the SAVEAS code line. If I
completely close down word and restart it, the speed jumps back to the nearly
1 second per report range. At first I thought the problem was specifically
involved with putting too many reports in the same directory but if I break
the code and change the output directory to one that is empty and continue
execution the speed still stays slow [until I close and restart word as
explained above]. Our plan is to create nearly 100,000 reports in this
manner so speed is important. Does anyone have suggestions? Thanks.
 
J

Jezebel

I was involved with an almost identical project a few years ago. We
concluded that the choice of Word as an output medium for Access was a
mistake. The problem appears to be memory leakage. There's nothing much you
can do about it other than close and re-start Word. You can put that into
your routine (it was one of the things we tried, too) -- every nth report
close and re-open Word -- but the time taken to do that is a heavy penalty.
On top of which, we found that the set-up as a whole is not stable enough
for this kind of intensive processing. Every so often Word and Access will
stop talking, for no obvious reason. So you set your application to run
overnight, and come back in the morning to find that it stopped at report
23456 with a meaningless error message.

We decided that Access's own formatting wasn't *that* bad.
 
S

Steven S. Silver

Thanks for the info. The reports we are generating require really beautiful
output so we will stick to word but we will do the external control routine.

From your description this is an old issue (I'm using 2003)! Is there a way
to strongly bring it to Microsoft's attention - I'd hate to just drop it
without letting them know?
 

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