CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    How to catch an exception in VB6

    I have VB application, in which I inserted an ActiveX control. The methods in this ActiveX control does not return any value. But if the input parameters are wrong or due to timeout, Out of range input value fails to execute the method. And the app gives an error and closes.
    Is there a way to catch the failure of execution?



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to catch an exception in VB6

    let's assume your ActiveX Control raises error with the err.Raise method:
    On Error Goto ErrLabel
    YourActiveXControl.Property = YourValue
    Exit Sub

    ErrLabel:
    ' catch the exception here!
    msgbox "invalid data"
    exit sub




Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured