View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 230
Default Iterative consolidation macro can't complete - memory overload?

On 28/11/2014 17:41, Stuart wrote:
Thanks :) It's XL2010.

I seem to have got it working, touch wood, through a combination of:

1) Storing the list of filenames in an array, i.e. doing the DIR loop first not during the main code.


It is probably a race condition in the filesystem somewhere. Likely to
be related to the one that caused another way of iterating through a
directory of files to be discontinued in XL2007.

2) Putting in application.waits of 1 second where files are being opened, closed or saved, to give Excel and the network drive time to sync

It seems to be working so far.


My guess with these is that they are an unfortunate effect of multiCPU
systems running code that isn't entirely proofed against reaching a
point where the consumer thread is reading uninitialised or partially
initialised structures. It is especially bad in the graphing/charts.

--
Regards,
Martin Brown