FIGURE 16.23
Implicit conversion warnings in the Error List.
If you are very skilled at writing code, and very lucky, at this point you could install and test the
code, and everything would work perfectly. But it’s more realistic to expect that there will be some
bugs in the code that will prevent the add-in from working, so it’s a good idea to do some debug-
ging at this point, to save the time you would spend going through the installation and then find-
ing that the add-in doesn’t work as expected.
Debugging the Add-in ............................................................................................
The Error List pane (mentioned in the previous section) helps you to locate any errors in your
code; you can double-click an item to go to the line of code that caused the error. When working
with an add-in, you can use the “Start Debugging” selection on the Debug menu to step through
the code — but first you have to select Access as the application to start when debugging. To do
this, select “CreateObjects Properties” from the bottom of the Project menu (if you are working
with a different project, its name appears instead of CreateObjects). Click the Debug tab and select
Access as the “Start external program” option selection. (Figure 16.24 shows the Select File dialog
that appears when you click the Browse button to the right of the “Start external program” option.)
Now you can set breakpoints in your code (using the F9 function key), as with Access VBA, and
when you select Start Debugging on the Debug menu, Access will open automatically. Select (or
create) a new database, and then click the add-in’s buttons to run and debug the code; it will stop
at the breakpoints you have set so you can step through the code with the F8 function key.
Part III Adding More Functionality to Office