Hello all,
I have a VBA routine that on each loop updates data from queries, prepares some formatting and then prints to pdf. This all works fine, the problem is that it starts off and produces each pdf in around 30 seconds but on each iteration this gets larger and larger (and there are 700 schools/iterations we need to produce the report for) in the end it slows Excel right down practically to a halt and I have to close down and reopen Excel - then everything is fast again.
Anyway I've narrowed the problem down to this function that changes a chart series and adjusts the scale depending on certain criteria. This function seems to be the one that causes the loop to take longer and longer. Has anyone any ideas what it could be??
Note that I've declared some worksheet types as module level public vars now to try and speed things up so these vars are declared at top of module (and so get declared only once during cycle instead of getting declared on every iteration of the loop)
Many thanks for any help:
For info this is an excerpt of what is declared at the top of the modulePlease Login or Register to view this content.
Please Login or Register to view this content.
Bookmarks