Microsoft KB Archive/117661

{|
 * width="100%"|

XL5: Visual Basic AddIns Method Example Incorrect

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c
 * Microsoft Excel for the Macintosh, versions 5.0, 5.0a

-

SYMPTOMS
In Microsoft Excel 5.0, in Visual Basic Reference Help, the example for the AddIns method returns the following error messages when you run it:

Run-time error '1004':

AddIns method of Application class failed

NOTE: Page 42 of the Microsoft Press book "Microsoft Excel 5 Visual Basic for Applications Reference," contains this same example.

CAUSE
This error occurs because the reference to the Solver add-in in the Set statement of the macro is incorrect. The correct name of the Solver add-in is "Solver Add-In."

RESOLUTION
To correct the statement, replace the name "Solver" in the Set statement with the name "Solver Add-In" as in the following example:

  Set currentAddIn = Application.AddIns("Solver Add-In")