Name
Err.Source Property
Data Type
String
Description
A read/write string property containing the name of the application or the object that has generated the error.
Rules at a Glance
When a runtime error occurs in your code, the Source property is automatically assigned the string “Microsoft VBScript runtime error.”
If the error occurs in an ActiveX component instantiated by your application, the Source property usually contains the class name or the programmatic identifier of the component that raised the error.
Programming Tips and Gotchas
Knowing what type of error has occurred within a program is often of little use if you don’t know where the error was generated. However, if you enhance the standard Source property by adding the name of the procedure, class, property, or method when you raise an error, your debugging time can be cut dramatically.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access