Excel Libraries for the Try function RRS feed

  • Question

  • I'm trying to use the Try function but Excel compiler returns "Sub or Function not defined." I assume that means I don't have the Library loaded.

    If that's correct, what library should I load or what Reference statement should I use to get the function? If I'm not right, how do I get Try to work?

    • Edited by Cordell2842 Saturday, February 24, 2018 3:15 PM
    Saturday, February 24, 2018 3:14 PM

All replies

  • Hi,

    Please use "On Error" statement like....
    On Error GoTo line      ' -- (*1)
    On Error Resume Next
    On Error GoTo 0
    (*1) "line" means Line number or Label.



    Sunday, February 25, 2018 12:54 AM
  • Cordell,
    re:  using  "Try"

    Try is not a valid expression in a VBA module.
    There is no library that loads it.
    With VBA you must write your own error handling code.

    Jim Cone
    Sunday, February 25, 2018 2:02 PM