Hello, I am new to vba, but I've worked in several other languages before, yet I am new to error handling and synchronizing a program in general.
In vba (for excel), I have a project that goes through a web form, fills it out, exports the resulting data to a csv in Excel, grabs the data off of the csv, puts it on a separate workbook, repeats the process until all of the forms are done and the workbook has all of the data.
Recently, I added in an error handler that would go through and, if the csv file had not finished downloading, thus giving the "Subscript out of range" error, it would loop through until the csv is finished downloading, is properly called, and dealt with.
The code works perfect when single stepping because the code has more time to wait on various objects and things like that, however when the program is run, it gets ahead of itself and trips over the csv, hence the error handler, and I am unsure how to synchronize the process and the MS Help tends to be simply god awful in assistance on such matters for some one of my youth in the field. (And yes, I have searched both the MS Macros Help and the Internet for a solution to no avail)
While I have the error handler, I still get the "Subscript out of range" error message (this is a new occurrence and did not happen before I tried to give the handler a way to get out of an endless loop by using an integer counter). Is there any recommendation/hints on how to synch/deal with the message/improve the method of the error handling? (possibly a command that would make the error handling loop pause temporarily???)
Bookmarks