Page 271 - Microsoft Office Excel 2003 Programming Inside Out
P. 271

Creating Add-Ins and COM Add-Ins

                    AddIn Object
                             The AddIn object represents a single add-in that’s available to Excel. Table 11-3 contains a list
                             of the properties associated with a single add-in.
                             Table 11-3.  AddIn Properties

                             Property      Type          Description
                             Application   Object        Returns the Application object representing the creator of
                                                         the add-in
                             CLSID         String        Returns the CLSID of the add-in
                             Creator       Long          Returns a 32-bit integer containing the binary value XCEL
                             FullName      String        Returns the full path and file name to the workbook
                                                         containing the add-in
                             Installed     Boolean       When True, means that the add-in is installed
                             Name          String        Returns the file name of the add-in
                             Parent        Object        Returns the parent object associated with the add-in
                             Path          String        Returns the path to the directory containing the add-in
                             ProgId        String        Returns the program identifier associated with the object

                             The Application and Parent properties can simplify referencing the application object that
                             created the add-in and the parent object of the add-in.
                             The Creator property returns a Long value corresponding to the four characters XCEL. This
                             property is useful when you wish to verify that the add-in was created for Excel.
                             The ProgId and CLSID properties only apply when using COM or automation-based add-ins.
                             These properties will return an empty string for Excel add-ins.
                             The Name, Path, and FullName properties contain information about the file name of the
                             add-in’s workbook. Name contains only the file name, whereas Path indicates which direc­
                             tory contains the add-in file. As you might expect, FullName combines the Path and Name
                             properties with a directory separator.

                             The Installed property controls whether that add-in is currently installed into Excel. Setting   Chapter 11
                             this property to True installs the add-in and triggers the Workbook_AddinInstall event. Setting
                             this property to False removes the add-in and fires the Workbook_AddinUninstall event.














                                                                                                       245
                                                                                                Part 4:  Advanced VBA
   266   267   268   269   270   271   272   273   274   275   276