Or Maybe I Can't Do This
Apr. 28th, 2015 04:08 pmHrmph. My report gets through about 10 iterations, then crashes with a stack-overflow error. Which appears to be caused by Excel VBA call stack filling up with my auto-generated macro calls. Googling about for "how to clear the call stack" has not made me optimistic about my odds of getting around this via VBA. x.x
no subject
Date: 2015-04-28 09:15 pm (UTC)===|==============/ Keith DeHavelle
no subject
Date: 2015-04-28 09:24 pm (UTC)no subject
Date: 2015-04-28 09:31 pm (UTC)If it's still in the child procedure when it's triggered again, I can see why the system is eventually recursing at you. ];-)
===|==============/ Keith DeHavelle
no subject
Date: 2015-04-28 09:32 pm (UTC)1. Data refresh event fires
2. Script saves data under new file name and initiates new batch
3. New batch is loaded, but this is still under the script since it is waiting for the return value of the command
4. Data refresh event fires (but inside the first script)
5. Now you have a fresh copy of the script running for the new filename
And so on until it runs out of stack.
If that were the case, what you'd want to do is (I'm not versed in Excel so I dunno) make it so the script explicitly isn't waiting for the 'get different batch' stuff to return, it just fires it off and leaves.
no subject
Date: 2015-04-28 09:34 pm (UTC)Could you move the 'get a new different batch' step into the outer loop, with some sort of delay so that it didn't try to fetch multiple batches concurrently? Or it could wait on a variable that you set in the event handler (checking the variable every X time period until it's true, then fetch a new batch).
no subject
Date: 2015-04-29 03:17 am (UTC)For Each batch_to_fetch In list_of_batches_to_fetch 'Grab the batch data' Do 'Check if data is refreshed Loop While {Data is not refreshed} 'Save batch under a new filename Next