Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Skip Errors
I'm not sure I like the term "skip errors", I prefer to use "trap errors" and
give an example of how I do it. Let's say I'm looking for a particular worksheet called 'Barbs Sheet'. Dim myWS as Worksheet Set myWS = nothing on error resume next Set myWS = Worksheets('Barbs Sheet') on error goto 0 if myWS is nothing then 'Worksheet not found else 'Worksheet found end if And do your execution from there. I'm in the process of modifying code in a workbook that has On Error goto (Some grouping of lines), and untangling it is a challenge, to say the very least. I don't leave 'On Error Resume Next' on for very long, only long enough to get through a line that *may* have an error until I can verify I have what I want. I find I need to add error trapping as I test, but I'd rather do it that way than have it run all the way to the end and not know where the problem really is. HTH, Barb Reinhardt "Elton Law" wrote: Dear Expert, Can I set a script at the very beginning of the macro to overrule all errors it encounter ? That is ... it would not halt / stop .... Even face errors ... immediately goto next line .... A script at the beginning to rule this .... Just go ahead and skip the error lines and keep on running with next line. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using IF to skip | Excel Worksheet Functions | |||
skip to next from if | Excel Programming | |||
skip errors in an average | Excel Worksheet Functions | |||
Excel Throwing Circular Errors When No Errors Exist | Excel Worksheet Functions | |||
Unresolved Errors in IF Statements - Errors do not show in results | Excel Worksheet Functions |