Results 1 to 3 of 3

Thread: Error Message Even when I have Error Handling

  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Error Message Even when I have Error Handling

    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???)

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: Error Message Even when I have Error Handling

    The problem that you are facing may occur if the following conditions are true:
    • The active cell is above the horizontal page break or to the left of the vertical page break that is referred to by the HPageBreaks or VPageBreaks index.
    • The vertical or horizontal page break location is off the screen to the right of the visible window or below the visible window of the workbook.

    For workaround, check this link - http://support.microsoft.com/kb/210663

  3. #3
    Join Date
    Jun 2012
    Posts
    3

    Re: Error Message Even when I have Error Handling

    Actually, after tinkering around a bit, I got the darned thing to work by taking out the elseif statements I had in the error handler, it will still occur if an error other than one handled by the handler (Currently only error #9 Subscript out of range) But yeah, this problem is solved for now, however this leads me to ask, why did it not like my elseif statements? (which were meant for further debugging) Does vba force me to create and OnError inside of the Error handler in order to sift through others?

Similar Threads

  1. Replies: 5
    Last Post: 04-05-2011, 10:50 AM
  2. Leakage and Improper Error Handling in Web applications
    By FaD KiNG in forum Technology & Internet
    Replies: 5
    Last Post: 01-02-2011, 05:27 PM
  3. What is an Error Handling and Newspapers in PHP?
    By SKREECH in forum Software Development
    Replies: 5
    Last Post: 09-03-2010, 06:18 AM
  4. MCI command handling window error
    By Bandish in forum Operating Systems
    Replies: 4
    Last Post: 28-07-2009, 11:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,466,770.91772 seconds with 17 queries