Its 2007 (latest version).
Ok well evidence is as follows:
- Macros are falling over which have been tried and tested on many different machines running xp, vista and win 7 and found to not cause any problems in normal circumstances.
- Macros are falling over generally at the point at which Excel has to do something to the data, eg change the style, copy/paste lots of values at once, insert/remove rows etc.
- The subject machine did feel very slow to use, and as I said, displays some graphical glitches when using the VBA editor just to step through simple macros (due to high cpu load/limited memory or whatever it might be).
- The errors are not repeatable, rather they display a pattern of similar circumstances (i.e. the same bits of code are not the problem), it seems to relate to how busy the computer was at the time (slight improvement seen when closing non-required programs to free up memory/cpu
- A copy was taken of the offending workbook and run on another fairly modest spec xp machine - this ran without fault, even when the amount of data in the workbook was manually trippled.
- Some speed measures are already in place to try to streamline the workbook (e.g use of option explicit, screen & event updating disabled during macros, only 3 modules present, shortened code where possible.
- After asking collegues about the problem this was recognised and confirmed as similar fault to another system. In the case of the other program, the only method of solution discovered was to introduce delay commands as has been mentioned in this thread. I could do this in my workbook, but it would be a lot of work to ensure compatibility with one machine! Hopefully when he's come back with a clean win 7 installation next week I can see if the problem is cured or whether it needs further work.
- If I step through the code one bit at a time, no faults are seen and the macro completes no problem.
I'm fairly sure what the cause is as a result; it must be the speed at which the functions are being performed surely?!