Microsoft KB Archive/840926

= You receive a &quot;Can't find project or library&quot; error message when you run a VBA project =

Article ID: 840926

Article Last Modified on 3/20/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition

-





SYMPTOMS
In Microsoft Office XP, you may use the Web Service References Tool that is included with the Microsoft Office XP Web Services Toolkit 2.0 to add a reference to a Web service in a Visual Basic for Applications (VBA) project. When you try to run this project in Microsoft Office 2003, you may receive the following error message:

Compile error:

Can't find project or library



CAUSE
In Office XP, the VBA project contains a reference to the Microsoft SOAP Type Library 3.0. However, Office 2003 uses the Microsoft Office SOAP Type Library 3.0 instead of the Microsoft SOAP Type Library 3.0. If VBA cannot locate the Microsoft SOAP Type Library 3.0 on your computer, the behavior that is mentioned in the &quot;Symptoms&quot; section occurs.



WORKAROUND
To work around this problem, add a reference to the Microsoft Office SOAP Type Library 3.0 in the VBA project. To do this, follow these steps:
 * 1) In the VBA editor, click References on the Tools menu. The References - VBAProject dialog box appears.
 * 2) Click to clear the MISSING: Microsoft SOAP Type Library v3.0 check box.
 * 3) Click Browse. The Add Reference dialog box appears.
 * 4) Locate and then click the Mssoap30.dll DLL that is included with Office 2003, and then click Open. A reference to the Microsoft Office SOAP Type Library 3.0 is added in the References - VBAProject dialog box.
 * 5) Click OK, and then run the project.



STATUS
This behavior is by design.



Steps to reproduce the behavior

 * 1) Install Office 2003.
 * 2) Install the Microsoft Universal Description, Discovery, and Integration (UDDI) Software Development Kit (SDK).
 * 3) Install Microsoft XML.
 * 4) Install the Microsoft Office 2003 Web Services Toolkit.
 * 5) Start Excel 2003.
 * 6) On the File menu, click Open. The Open dialog box appears.
 * 7) Locate and then click an Excel worksheet that contains a VBA project that is similar to the VBA project that is mentioned in the &quot;Symptoms&quot; section, and then click Open.
 * 8) On the Tools menu, point to Macro, and then click Visual Basic Editor. The VBA editor appears.
 * 9) To run the VBA project, click Run Sub/UserForm on the Run menu.

