Scott,
I'm really not sure what to offer here.
I tried your sample in Outlook 2000, and it worked fine.
It works in Outlook XP fine also.
I suspect there is something else going on here, but I do not know what that
would be.
Remember that you should give both the description and number when you use
the Err.Raise method.
Good Luck!
Hope this helps
Jay
Quote:
> Hi Jay
> Outlook 2000 SR-1 Version 9.0.0.5414
> Windows 98
> In the Declarations Section -
> Const Operator_Canceled = vbObjectError + 1002
> I had this in one line without the end if and broke it
> down to make sure everything was clean.
> If frmProgressBar.Canceled Then
> -----> Err.Raise Number:=Operator_Canceled <------- This
> is the line
> End If
> Hope you can shed some light on this.
> Scott
> >-----Original Message-----
> >Scott,
> >Which version of Outlook?
> >I'm on Outlook XP running on Windows XP, I'm not seeing a
> real problem
> >here...
> >How is Operator_Canceled defined, it should be a Long.
> >What line are you receiving the "Invalid procedure call
> or argument" on.
> >Specifically?
> >This works in the VBIDE within Outlook XP:
> >Sub Test()
> > Dim Operator_Canceled As Long
> > Operator_Canceled = vbObjectError + 1002
> > On Error GoTo MsgClassError
> > If Operator_Canceled Then
> > Err.Raise Number:=Operator_Canceled,
> Description:="Scott's Error"
> > End If
> > Exit Sub
> >MsgClassError:
> > MsgBox Err.Number & " : " & Err.Description
> >End Sub
> >> Thanks for your reply Jay,
> >> Operator_Canceled = vbObjectError + 1002
> >> On Error GoTo MsgClassError
> >> If frmProgressBar.Canceled Then Err.Raise
> >> Number:=Operator_Canceled
> >> This generates the error "Invalid procedure call or
> >> argument".
> >> And so does this: Err.Raise Operator_Canceled
> >> And so does this: Err.Raise 278
> >> MS reference and the VB help have this as the syntax
> >> Err.Raise 6 ' Generate an "Overflow" error.
> >> I checked the spelling of vbObjectError and used paste
> to
> >> set Operator_Canceled so that wouldn't be a problem.
> >> I should be getting to this handler.
> >> MsgClassError:
> >> Select Case Err.Number
> >> Case Is = Operator_Canceled
> >> MsgBox "You have canceled the process."
> >> frmProgressBar.Hide
> >> Exit Sub
> >> Case Else
> >> ErrorTrap = MsgBox("Unhandled Error
> In " &
> >> Err.Source & vbCrLf _
> >> & " Error " & Err.Number & vbCrLf _
> >> & Err.Description, vbCritical +
> >> vbOKCancel, "Error Trap")
> >> If ErrorTrap = vbCancel Then Err.Clear
> >> End Select
> >> On Error GoTo 0
> >> End Sub
> >.