Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"Macros may contain viruses" error message when you open files without macros in Excel


View products that this article applies to.

Symptoms

When you open a Microsoft Excel file that does not contain macros, you receive the following error message:
filename contains macros.

Macros may contain viruses. It is always safe to disable macros, but if the macros are legitimate, you may lose some functionality.
To close the error message, click Disable Macros, Enable Macros, or More Info.

↑ Back to the top


Cause

This behavior may occur if the Excel file contained a macro that was deleted, but the Microsoft Visual Basic for Applications (VBA) module that contained the macro was not deleted.

↑ Back to the top


Resolution

To resolve this behavior, delete the empty VBA module. To do this, follow these steps:
  1. Open the Excel file, and then click Disable Macros when you receive the error message.
  2. Press ALT+F11 to start the Microsoft Visual Basic Editor.
  3. In the Project Explorer window, locate the file name. For example, locate "VBAProject file name.xls" (without quotation marks).
  4. Expand the Object list.
  5. Expand the Module list.
  6. Select any module that appears under the Modules list, right-click the module, and then click Remove Module_name on the File menu. (The module is probably named "Module1," "Module2," "Module4," or a similar name).

    Click No when you receive the following message:
    Do you want to export Module_name before removing it?
  7. Close the Visual Basic Editor, and then save the Excel file.

↑ Back to the top


Keywords: KB329950, kbprb, kberrmsg, kbopenfile, kbmacro

↑ Back to the top

Article Info
Article ID : 329950
Revision : 4
Created on : 2/1/2007
Published on : 2/1/2007
Exists online : False
Views : 320