Note: These instructions are for users of Microsoft Visual Studio .NET or Visual Studio 2005. For instructions on debugging a project under Microsoft Visual Studio 6, click here.
As soon as Excel starts, it will attempt to open your the Debug build of your add-in. (This is because the XLL+ AppWizard set the "Command Arguments" property of the configuration to "$(TargetDir)/Tutorial1.xll" when the project was created.)
In Excel, put a formula into a spreadsheet, as shown below.
Activate Visual Studio - you do not need to close Excel to do so. Select Tutorial1.cpp and use the F9 key (or the right-mouse menu) to add a break-point to the add-in function, as shown below.
Force a formula cell to recalculate. The easiest way to this is to go to the cell you want to recalculate (in this case, cell B1) and click on the F2 key then the Enter key. (Alternatively, you can simply change the value in cell A1.)
After you press Enter, Excel will call the add-in function and the DevStudio debugger will break at the break-point. You can step through the lines of the function (with F10 and F11) or continue (with F5).
Close Excel and return to Visual Studio. We are now ready to add another add-in function.