XL5: Visual Basic AddIns Method Example Incorrect

Last reviewed: February 2, 1998
Article ID: Q117661
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")

REFERENCES

Microsoft Press, "Microsoft Excel 5 Visual Basic for Applications Reference," page 42


Additional query words: 5.00 5.00a 5.00c addin
Version : WINDOWS: 5.0, 5.0c; MACINTOSH: 5.0, 5.0a
Platform : MACINTOSH WINDOWS
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.