Microsoft KB Archive/184981

= WD97: "Can't Find Project or Library" When You Run a Macro =

Article ID: 184981

Article Last Modified on 1/22/2007

-

APPLIES TO


 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q184981



SYMPTOMS
In Microsoft Word, when you attempt to run a WordBasic macro that has been converted to a Microsoft Word Visual Basic for Applications macro, you may receive the following error:

Can't find project or library

Also, while in the Visual Basic Editor, when you check the installed object libraries in the References dialog box (click References on the Tools menu) the Word object type library "Microsoft Word 8.0 Object Library" is missing.



CAUSE
If all of the symptoms described apply to you, and the compile error "Can't find project or library" occurs at command lines beginning with the WordBasic object, for example x$ = WordBasic.GetFormResult$("Text1") your computer may be infected with the TWNO.A macro virus.



WORKAROUND
If you suspect that your computer is infected with a macro virus, please see the following articles in the Microsoft Knowledge Base:

181079 What to Do If You Have a Macros Virus

163932 Frequently Asked Questions About Word Macros Viruses

For more information about macro virus protection software available from third-party vendors, click the following article number to see the article in the Microsoft Knowledge Base:

49500 List of Antivirus Software Vendors

After you have made sure you have eradicated all possible macro viruses from your computer, documents and templates, and/or you are sure your computer, documents and templates are not infected, follow these steps to fix the template containing the converted WordBasic macros:  Open the template containing the converted WordBasic macros:

 On the File menu, click Open. In the Files Of Type list, click "Document Templates(*.dot)." Navigate to the folder containing the template. In the list of files, click to select the template and click OK.

NOTE: If you are prompted to Enable Macros, or Disable Macros, click Enable Macros. </li> On the Tools menu, point to Macro, and then click Visual Basic Editor.</li> In the Visual Basic editor, click Project Explorer on the View menu.</li> In the Project Explorer window, click to select your template project.</li> On the Tools menu, click References.</li> In the list of Available References, click to select any valid reference's check box, and click OK.</li> On the File menu click Save.</li> On the File menu click "Close and Return to Microsoft Word."</li> In Word, click Close on the File menu to close the template.</li> Repeat steps 1-5.</li> Click to clear the check box for the reference you added in step 6, and click OK.</li> On the Debug menu, click Compile <your template project name>.</li> On the File menu, click Save.</li></ol>

If the error continues to occur after performing these steps, quit all Microsoft Office programs that are running. Then, uninstall and reinstall Microsoft Office.

For additional information, please see the following article in the Microsoft Knowledge Base:

158658 How to Completely Remove Microsoft Office 97

Additional query words: can t

Keywords: kberrmsg kbprb kbprogramming kbvirus KB184981

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.