Re: On Error Resume Next

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you Nick for your input.

I would also like to add that anyone who is not sure of the potential risk
involved here. Please... Do a little research and make up your own mind. I
can only express my oppinion here, but I would hate to see someone get in a
bad situation thinking that it was ok because they learned it on this news
group.

Bob Calvanese

"Nick Hodge" <nick_hodgeTAKETHISOUT@xxxxxxxxxxxxxxxxx> wrote in message
news:OowHuidPFHA.2356@xxxxxxxxxxxxxxxxxxxxxxx
> Bob
>
> The overall tenure of your statement is correct. In general On Error
> Resume Next is 'lazy' programming. It is used extensively here as most
> code is by way of example or code which is only run one or does very
> insignificant tasks. If this were not the case less answers would be
> given and people would be a lot more wary to do so, as they would have to
> write full error checking code each time.
>
> Seldom do problems of the magnitude you set out occur, in fact most of the
> time these statements purely stop the code from dropping out for trivial
> errors. (Chart sheet selected instead of worksheet, etc). Granted, it
> could happen the way you outline, but far more mistakes are made in
> functions and linking causing that type of anomaly than would ever be the
> case in code.
>
> All together, I agree, generally bad practice unless you know the outcomes
> you may get
>
> Just my £0.02
>
> --
> HTH
> Nick Hodge
> Microsoft MVP - Excel
> Southampton, England
> nick_hodgeTAKETHISOUT@xxxxxxxxxxxxxxxxx
>
>
> "rcalvanese" <bcalvanese@xxxxxxxxxxx> wrote in message
> news:SradnfbmjfJ2ssTfRVn-tw@xxxxxxxxxxxxxx
>>I have been reading many posts where I see "On Error Resume Next" being
>>used As well as "On Error GoTo 0" (which basically disables the error
>>handeling for the method). I was taught in school that this is a bad
>>programming practice and if we used it in our projects, we would have
>>points taken off our grade. When I began programming for a living, I
>>noticed it was looked down upon by every IT Manager that I have ever met.
>>One example that I can give is as follows:
>>
>> I was working for a telemarketing company who used VB5/VB6/VBA for just
>> about all reporting because all cleint reporting was done in Excel. A
>> client report that had been being run for about 6 months was calculating
>> incorrectly. This calculation was used by our client to make business
>> decissions and had been incorrect for the 6 months that the report was
>> being run. I don't know all the details about the business end of it,
>> but... Our company wound up having to eat 2 millin dollars. The IT
>> manager went to the programmer who wrote the report and found that he had
>> used On Error Resume Next in several places in his code. Upon commenting
>> them all out and running the report, he was able to find the error that
>> caused the calculation problem.
>>
>> Needles to say, the programmer was let go the next day.
>>
>> This is only my oppinion based on what I have learned and experienced
>> thus far. To me it just sets a potential for dissaster. I have done a lot
>> of Excel development over the years, but not in Excel itself. I choose to
>> control excel automation from outside, and have developed some fairly
>> large systems in VB6, and .NET. But it's just a prefference of mine not
>> having to maintain all those proprietary macro's and having them attached
>> to the spead sheet.
>>
>> So anyway... I see this being used pretty extensively here and would like
>> to hear other oppinions as to why people would use this. Sure there are
>> instances where you could save a few lines of code, but a programs
>> effeciency is not measured by how few lines of code are used. And if
>> there are exceptions in anything that I develop... I want to know about
>> it.
>>
>> All oppinions welcome...
>>
>> Bob Calvanese
>>
>
>


.



Relevant Pages

  • Re: Just A Suggestion
    ... fundamentals of programming. ... capability to automate Excel and other Office apps. ... > the network and can utomate any excel report. ... >> My approach to this was to develop a generalized macro in a single ...
    (microsoft.public.excel.programming)
  • Re: On Error Resume Next
    ... Next is 'lazy' programming. ... Microsoft MVP - Excel ... > client report that had been being run for about 6 months was calculating ... > to hear other oppinions as to why people would use this. ...
    (microsoft.public.excel.programming)
  • On Error Resume Next
    ... When I began programming for a living, ... decissions and had been incorrect for the 6 months that the report was being ... Excel development over the years, ... hear other oppinions as to why people would use this. ...
    (microsoft.public.excel.programming)
  • Re: why>?
    ... Just because PDF is more popular than SNP; ... Emailing a dynamic report is easier than emailing PDF files.. ... Excel is ALWAYS less efficient than Access. ... e) multi-user functionality - being able to work on the same report / ...
    (microsoft.public.excel)
  • Re: Lambda Shambda
    ... Although a Ruby fan, I must say I'm spending all my time looking at ... functional programming at the moment. ... VBA (which is what Excel uses for macros), or are you saying that you use ... good language design or how to define "compatible" continue. ...
    (comp.lang.ruby)