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

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 - VBAProjectdialog 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
Propriedades

ID do Artigo: 840926 - Última Revisão: 13 de mai de 2008 - Revisão: 1

Comentários