I‘m loading about 1,000,000 records from a text file, each about 200 characters long. I have a loop that pushes each one successively into the same cell, does a recalculate to produce a result in another cell, which it then captures and writes to a file.
I was getting out of memory errors and watched the memory usage using task manager. The memory usage was steadily increasing - guess until it hit the limit. But I’m unsure why? And I also noticed that the loop goes quickly for the first few hundred thousand and then slows to around 1/10th the speed. (All the records are about the same length and effectively the same content. I deleted all the calculation cells that refer to the cell that I push the value into, so all that now remains is a loop that pushes a value into a cell - and the behaviour is the same.)
I slammed a bunch of DoEvents in there in the hope that might help, but no joy.
I wondered if it was due to the length of the string, and sure enough when I reduced the length (left 30 characters only pushed into the cell) it worked fine.
Any idea what’s causing it?
Any idea of a decent workaround? I tried using a Name and pushing the string into that - and that worked better - although noticeably slow, and eventually locks my laptop up (the loop does however finish I just have to reboot to regain access to my laptop!).
Any idea much appreciated. (I of course know I could do it all inside VBA without touching the cells, but I’m making use of Excel’s calculation sequencing in the cells that when I reinstate them will depend on the input cell.)
I was getting out of memory errors and watched the memory usage using task manager. The memory usage was steadily increasing - guess until it hit the limit. But I’m unsure why? And I also noticed that the loop goes quickly for the first few hundred thousand and then slows to around 1/10th the speed. (All the records are about the same length and effectively the same content. I deleted all the calculation cells that refer to the cell that I push the value into, so all that now remains is a loop that pushes a value into a cell - and the behaviour is the same.)
I slammed a bunch of DoEvents in there in the hope that might help, but no joy.
I wondered if it was due to the length of the string, and sure enough when I reduced the length (left 30 characters only pushed into the cell) it worked fine.
Any idea what’s causing it?
Any idea of a decent workaround? I tried using a Name and pushing the string into that - and that worked better - although noticeably slow, and eventually locks my laptop up (the loop does however finish I just have to reboot to regain access to my laptop!).
Any idea much appreciated. (I of course know I could do it all inside VBA without touching the cells, but I’m making use of Excel’s calculation sequencing in the cells that when I reinstate them will depend on the input cell.)