This article was previously published under Q188919
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
When developing Visual Basic components to run under control of MicrosoftTransaction Server (MTS), if your object uses ObjectContext, you mayencounter the following error when trying to debug them within the VisualBasic environment:
Run-Time Error '91': Object variable or with block variable not set.
This article describes how to configure Visual Basic to allow you to debugthese components using the special debug version of GetObjectContext.
There are two ways to avoid this error when writing Visual Basiccomponents. The first is to configure Visual Basic to use a special versionof the object context. The second way is to use the Microsoft DeveloperStudio environment.
To facilitate application debugging using Visual Basic, you can debug acomponent that uses ObjectContext by enabling a special version of theobject context. This debug-only version is enabled by creating thefollowing registry key: