Microsoft Office Tutorials and References
In Depth Information Debugging add-ins
Add-ins and COM Add-ins
Excel 2000 supports the same add-in model that is supported by Excel 97. This is the
add-in model that we use to create the SRXUtils add-in.
In addition, the Office 2000 suite supports a new add-in model called the COM add-in
model. A COM add-in is an ActiveX DLL or executable file that can be connected to
multiple Office 2000 applications. Since this type of add-in is an ActiveX DLL or
executable, it must be created using a programming environment, such as Visual Basic
or Visual C++, that is capable of creating these types of files. However, Visual Basic for
Applications cannot create ActiveX DLLs or executables, so it cannot be used to create
COM add-ins. Debugging add-ins
An add-in can be debugged just like any other Excel workbook. You do not need to refer again to
the original XLS file.
In particular, an add-in can be opened like any other Excel workbook. However, unless you know
the password (assuming that the add-in has one), you will not be able to see either the add-in's
code or its workbook window. Using the password, you can expand the project node in the Project
window to view the code and, if you select the ThisWorkbook node and open the Properties
window, change the IsAddIn property to False to display the workbook window. Now you can
treat the workbook just like any other Excel workbook. Once the necessary changes have been
made, you can recompile the code and return the IsAddIn property to True . Deleting an add-in
You may have noticed that the Add-Ins dialog shown in Figure 10-5 d oes not have a Delete button.
To remove an add-in from the list, uncheck the add-in, rename the XLA file, and then check the
add-in again. You will get a message asking if Excel should remove the add-in from the list. And
while we are on the subject of idiosyncratic behavior, note that changes to an add-in's Title
property may not be reflected in the Add-Ins dialog until Excel is shut down and reopened.
10.3 An Example Add-In
Let's begin the creation of an Excel add-in by creating an add-in shell. This will demonstrate the
process of add-in creation and provide a starting point from which we can create a full-fledged
add-in-based Excel application, adding new features as we proceed through the topic. I strongly
suggest that you follow along in the creation process.
In this chapter, we will create the add-in shell whose features just display message boxes (for
now). At this time, we do not want to cloud the issue of add-in creation by implementing any real
features. In Chapter 12 , we will increase the number of mock features so that we can demonstrate
how to handle multiple features in an add-in, as well as how to create a custom menu system for
an add-in. In later chapters, we will implement these features and add additional ones.
10.3.1 Creating the Source Workbook
Search JabSto ::

Custom Search