런타임 오류를 생성합니다.
구문
object.Raise(number, source, description, helpfile, helpcontext)
주:
helpfile, helpcontext는 선택사항이며 지원되지 않습니다.
인수
주석
숫자를 제외한 모든 인수는 선택적입니다. 그러나 Raise를 사용하는 경우 일부 인수를 지정하지 않고 Err 객체의 등록정보 설정에 지워지지 않은 값이 포함되어 있으면 해당 값이 오류의 값이 됩니다.
다음 예에서는 Raise 메소드의 사용을 보여 줍니다.
예 1:
Sub RaiseOverflowError() On Error Resume Next ' Enable error handling. Err.Raise 6 ' Raise an overflow error. Err.Clear ' Clear the error. End Sub 'Output: Number: 6, Description: Overflow
예 2:
Sub RaiseCustomError() On Error Resume Next ' Enable error handling. Err.Raise 1000, "MyApp", "A custom error has occurred." Err.Clear ' Clear the error. End Sub 'Output: Number: 1000, Description: A custom error has occurred., Source: MyApp