Applies To
AddIns Collection.
Description
Adds a new add-in file to the list of add-ins. Returns an AddIn object.
Syntax
object.Add(fileName, copyFile)
object
Required. The AddIns object.
fileName
Required. The name of the file containing the add-in you wish to add to the list in the add-in manager.
copyFile
Optional. Ignored if the add-in file is on a hard disk. If True and the add-in is on removable media (a floppy disk or CD-ROM), the add-in will be copied to your hard disk. If False, the add-in will remain on the removable media. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.
Remarks
This method does not install the new add-in. You must set the Installed property to install the add-in.
See Also
Installed Property.
Example
This example inserts the add-in MYADDIN.XLA from drive A. When you run this example, Microsoft Excel copies the file A:\MYADDIN.XLA to the LIBRARY folder on your hard disk and adds the add-in title to the list in the Add-Ins dialog box.
Set myAddIn = AddIns.Add(filename:="A:\MYADDIN.XLA", _ copyfile:=True) MsgBox myAddIn.Title & " has been added to the list"
In Microsoft Excel for the Macintosh, this example copies the add-in from the disk labeled Add-In Disk to the Macro Library folder.
Set myAddIn = AddIns.Add(filename:="Add-In Disk:My Add-In", _ copyfile:=True) MsgBox myAddIn.Title & " has been added to the list"