Microsoft KB Archive/321449

= WD2001: &quot;Compile Error: Can't Find Project or Library&quot; Error Message When You Quit Word =

Article ID: 321449

Article Last Modified on 2/1/2007

-

APPLIES TO


 * Microsoft Word 2001 for Mac

-



This article was previously published under Q321449



SYMPTOMS
When you quit Word, you may receive the following Microsoft Visual Basic error message:

Compile Error:

Can't find project or library

The macro virus protection feature in Word may be turned off, and you cannot turn it back on.



CAUSE
This problem may be the result of a macro virus.



RESOLUTION
Microsoft does not provide software that can detect or remove computer viruses. If you suspect or confirm that your computer is infected with a virus, obtain current antivirus software. For a list of antivirus software manufacturers, click the following article number to see the article in the Microsoft Knowledge Base:

49500 List of Antivirus Software Vendors

To remove the virus, clean Word, and then clean the infected files, follow these steps:  Install an antivirus program. For a long-term solution to macro viruses, install antivirus software that is specifically designed to detect macro viruses. For additional information about antivirus software vendors, including software that can detect and prevent macro viruses, click the article number below to view the article in the Microsoft Knowledge Base:

49500 List of Antivirus Software Vendors

Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

 Quit Word. In the Finder, open the hard disk. Open the System Folder:Extensions folder, and then drag the following files to the Trash:  Microsoft Component Library Microsoft Internet Library</li> Microsoft OLE Automation</li> Microsoft OLE Library</li> Microsoft Structured Storage</li></ul> </li> Drag the following files from the System:Preferences folder to the desktop: <ul> Word Settings (9)</li> Embedding Preferences</li> PPC Registration Database</li></ul> </li> Drag the Normal template to the desktop.

The Normal template file is typically located in the root of the Microsoft Office 2001:Template folder.</li> Restart the computer, and then rebuild the desktop.</li></ol>

How to Remove Macros from Your Document
To clean the infected document, remove the macro component from the document by using either of the following methods.

CAUTION: Press and hold down SHIFT when you open a file that may be affected by a macro virus. This prevents Word from running any auto macros; therefore, if a macro virus is present, Word does not load it.

Method 1: Remove the Macro Storage Component
Macros that are contained in your Word document or template are saved in a module. To remove the module from your Word document or template, follow these steps.

NOTE: Removing a module removes the macros that it contains.

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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

<ol> Open the document.

CAUTION: Press and hold down SHIFT when you open a file that may be affected by a macro virus. This prevents Word from running any auto macros; therefore, if a macro virus is present, Word does not load it.</li> On the Tools menu, point to Macro, and then click Visual Basic Editor.</li> In the Project window, expand the document (template) project. The document (template) project will look similar to the following example:

Project

NOTE: If the Project window is not visible, click Project Explorer on the View menu. To expand the document (template) project, click the plus sign to the left of the Project .</li> Expand the Modules folder.

NOTE: The modules folder exists only if the document contains a macro.</li> Click the module. For example, click NewMacros.

NOTE: The name of the module that is listed may be different in your document (template) project. For example, it may be named Module1.</li> On the File menu, click Remove . When you are prompted to export the module before removing it, click No.

NOTE: If you are not sure whether the module that you are removing contains macros, click Yes, and then export the module as a Basics Files (*.bas).</li> Repeat steps 5 and 6 for each module that is listed under the Project Modules folder.</li> <li>On the File menu, click Close and return to Microsoft Word.</li> <li>Save and close the Word document (template).</li></ol>

Method 2: Save the Word Document in Rich Text Format (RTF)

 * 1) Open the document.

CAUTION: Press and hold down SHIFT when you open a file that may be affected by a macro virus. This prevents Word from running any auto macros; therefore, if a macro virus is present, Word does not load it.
 * 1) On the File menu, click Save As.
 * 2) In the Save as type box, click Rich Text Format (*.rtf), and then click Save.

When you are prompted to confirm saving in RTF, click Yes
 * 1) On the File menu, click Close.
 * 2) On the File menu, click Open, and then open the RTF document that you saved in step 3.
 * 3) On the File menu, click Save As.
 * 4) In the Save as type box, click Word Document (*.doc), and then click Save.

If you are saving the file back to its original file name, click Yes when you are prompted to confirm replacing the existing file.
 * 1) Close the document, and then reopen it.

Word does not save any macros or remaining macro storage components to the new document.

NOTES
 * You can set the Macro Virus Protection option that is designed to notify you if you open a file that contains macros, regardless of what the macros do. (In Word 2001 for Mac, on the Edit menu, click Preferences and then click the General tab. In Word 2001 for Mac, on the Word menu, click Preferences and then click General.) For a permanent solution, you must use antivirus software that is specifically designed to detect and prevent macro viruses.
 * Word does not look for macro viruses or remove any macro viruses from existing documents and templates. It only warns you if the document that you are opening contains macros. You can then open the document and either allow or disallow the macros to run. Do not allow the macros to run unless you are sure that the document contains no macro viruses.
 * You must update third-party antivirus programs frequently for them to remain effective. Contact the vendor for update information.
 * Disinfectant, a freeware antivirus utility for the Macintosh, does not protect against macro viruses. Because Disinfectant will not be updated for future viruses or worms, the current version of Disinfectant, 3.7.1, is the final version.

For additional information about macro viruses, click the article numbers below to view the articles in the Microsoft Knowledge Base:

291824 OFF2001: What to Do If Your Computer Has a Macro Virus

311382 MacOFF: Frequently Asked Questions Macro Security Updates

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Additional query words: MacWDX WDX macword mac WD2001KB

Keywords: kberrmsg kbprb KB321449

-

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

© Microsoft Corporation. All rights reserved.