I wrote a code to scrape web information from Google Patents in VBA which works pretty well but unfortunately it is pretty susceptible to two errors.
The two most common are
- runtime error
- Windows OLE is waiting for ...
All that needs to happen when this occurs is just press ok, ctrl break, F5 and execute again. Also for reasons unknown to me the code seems to slow down after x minutes and then breaking and restarting it accelerates the speed.
So as a patch-all solution I'd like to do the following. After x minutes (or even better after let's say 40 iterations), automatically break the execution and start again. A second error-handling way which would be great is do something like
If Range("A1".End(xlDown)) at time t = Range("A1".End(xlDown)) at time t + 600 Then restart code execution Else continue code execution
I'm basically hoping to automate my error handling so that I can run the code overnight and sleep like a baby :)