Step 1: To build the Debug version, use Visual Studio's Build - Configuration Manager... menu option and select the Debug configuration as Debug mode
Step 2: Select the Project in the Solution Explorer and show its Properties page. Select the "Debugging" node in the left pane, and change the "Command" property to the preferred version of EXCEL.EXE. (You can omit this step if you do not need to change the Excel version from the beginning)
Step 3: Press F5 (or use the Start - Debug menu option) to start Excel.
Step 4: 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.)
Step 5: Use the add-in function in Excel
Step 6: You need to set a break-point in VC 2005 (use the F9 key (or the right-mouse menu) to add a break-point to the add-in function)
Step 7: Let the formula cell calculate. The ways to go to the cell and click on the F2 key then the Enter key. (Alternatively, you can simply change the value of dependent cell and the Excel will automatically recalculate)
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.
No comments:
Post a Comment