Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Handler (VBA )

    > 11.5 microseconds
    Yes. 11.5 * 50,000 * 26 / 1,000,000; about 15 seconds, I think. I'd spent two days (16 hours) getting ready to show just how bright I was.

    > can eventually add up
    Agreed, but they should be proved to have the capability to do so first
    Let's assume that Legare 's method saves 11.5 microseconds (more code, but today's computers are faster), and it gets used each pay period in 50,000 Excel applications across the planet. It is still only 15 seconds. I suspect at that point we are more interested in readability; that is, the labour cost of maintenance.

    > I may well never look at again
    I not only agree, but I practice. About a year ago, after my annual "On Error" rant, I searched my utils.dot for On Error and discovered that 50% could be tossed out, and the remaining 50% were tucked away in blnExists functions which are, for me, effectively native VBA now. I see no harm in that, because it is not a substitute for weak logic, but a means of overcoming what I see as a design limitation.

    Overall I tend to question any On Error code and ask that the author justify it by showing it is necessary. In particular I detest On Error code that deals with an event (e.g. "File does not exist") that could have been dealt with in the code. That is, you have to write code to deal with it anyway, so why not deal with it without triggering an error? One of these days I'm going to take an existing procedure with, say, half a dozen IF statements and reduce it to inline code with a cascade of half a dozen Error handling blocks. Should be fun!

    Best Wishes. On Error forgive my rant!

  2. #17
    Lounger
    Join Date
    Apr 2005
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Handler (VBA )

    Thanks All.. I will try and see which one suits the best

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •