XL97: Error '32813' When Creating Reference to Solver Add- in

ID: Q185002

The information in this article applies to:

SYMPTOMS

When you run a Visual Basic for Applications macro that creates a reference to the Solver add-in, you may receive the following error message:

    Run-time error '32813':
    Name conflicts with existing module, project, or object library

CAUSE

This will happen if the following are true:

WORKAROUND

Instead of using the Application object for the VBE and ActiveVBProject properties, use the ThisWorkbook object with the VBProject property.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/

 Sub auto_open()

   Dim solverpath As String

   ' Get the path to the Solver add-in.
   solverpath = Application.LibraryPath & "\solver\solver.xla"

   ' Create a reference to the Solver add-in
   ThisWorkbook.VBProject.References.AddFromFile solverpath

 End Sub

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

REFERENCES

For more information about using references, click the Office Assistant in the Visual Basic Editor, type "references," click Search, and then click to view "Set a Reference to a Type Library."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q120802
   TITLE     : Office: How to Add/Remove a Single Office
               Program or Component

Additional query words: XL97
Keywords          : kbdta KbVBA 
Version           : WINDOWS:97
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: May 18, 1999