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



The information in this article applies to:

  • Microsoft Office Excel 2003
  • Microsoft Excel 2002
  • Microsoft Excel 2000
  • Microsoft Excel 97 for Windows

This article was previously published under Q329950

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.

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.

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.

Modification Type:MajorLast Reviewed:8/10/2006
Keywords:kbmacro kbopenfile kberrmsg kbprb KB329950