You receive a "Can't find project or library" error message when you run a VBA project

Article translations Article translations
Article ID: 840926 - View products that this article applies to.
Expand all | Collapse all

On This Page

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 "Symptoms" 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.

MORE INFORMATION

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 "Symptoms" 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.

REFERENCES

For more information, visit the following the Microsoft Developer Network (MSDN) Web sites:
What's New in the Microsoft Office 2003 Web Services Toolkit
http://msdn2.microsoft.com/en-us/library/aa192537(office.11).aspx

Microsoft Office XP Web Services Toolkit 2.0
http://msdn2.microsoft.com/en-us/library/aa140324(office.10).aspx

Properties

Article ID: 840926 - Last Review: March 20, 2007 - Revision: 2.4
APPLIES TO
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio .NET 2003 Professional Edition
Keywords: 
kbvs2005swept kbvs2005applies kberrmsg kbupgrade kbwebservices kbprb KB840926

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com