Click to See Complete Forum and Search --> : How to catch an exception in VB6


Latha Bulusu
April 8th, 1999, 11:47 AM
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?

Lothar Haensler
April 8th, 1999, 11:52 AM
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