Good day!
So this is the code I use to take screenshots of a certain program at a specific time interval.
This works perfectly at home but at work for some reason it encounters the 400 error after a few iterations. Last time I tried, it crashed after about 10 minutes. What I've observed is that the longer the wait time I set, the faster the macro crashes. Setting the wait time to 5 minutes, I can only take 2 screenshots and then the next one ends up with an error. I'm new to vba but maybe calling the sub which pastes (the screenshot to the excel file) within the sub crashes the whole thing? What I don't understand is when I'm at home I can even set the waiting time to 30 mins and the thing still works perfectly. I've tried it before and it worked for 6 hours or more without crashing.
Alternately, how do I go about creating a separate sub for the waiting time and then looping that together with the screenshot+paste sub? So basically, I want to be able to create a macro that would be able to take a screenshot once I press run, wait 30 seconds for a new sheet to open and the second screenshot to be pasted, then wait another 30 minutes and repeat from the beginning. So far I've been able to do everything except the second waiting time of 30 mins. I want to be able to write a code with a loop do until function and just call the subs I will create but I don't know how to do it with the variables I have.
Thanks in advance for any help.
Bookmarks