Microsoft Office 2000/Visual Basic Programmer's Guide   

Debugging a COM Add-in

When you're developing a COM add-in in Visual Basic, you can debug the add-in by putting the project into run mode. With the project in run mode, you can load and use the COM add-in from within an Office 2000 application to test and debug it by using any of the Visual Basic debugging tools.

To debug a COM add-in in Visual Basic 6.0

  1. Open the add-in project in Visual Basic 6.0.

  2. Place any desired breakpoints, Stop statements, or watches in the code.

  3. On the Run menu, click Start with Full Compile. This compiles your project, alerting you to any compilation errors, and then puts the project into run mode.

  4. Open the intended host application for the COM add-in. If you've set the add-in's load behavior to Startup or Load at Next Startup Only, the add-in loads as soon as you start the application. If the add-in's load behavior is set to None or Load on Demand, open the COM Add-ins dialog box and select the check box next to your add-in to load it.

When the add-in loads, the OnConnection event occurs. You can now enter break mode in the add-in project in Visual Basic 6.0 and debug the code.