XL: File Is Damaged After It Is Cleaned by Antivirus Software

Last reviewed: January 15, 1998
Article ID: Q179373
The information in this article applies to:
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for Windows, versions 5.0, 5.0c

SYMPTOMS

When you try to open, close, or save a workbook, the following error message may appear:

   This program has performed an illegal operation and will be shut down.
   If the problem persists, contact the program vendor.

If you click Details, an error message similar to one of the following appears:

   EXCEL caused an invalid page fault in module EXCEL.EXE at 0137:3001b963.

   -or-

   EXCEL caused an invalid page fault in module KERNEL32.DLL at
   0137:3001b693.

When you click Close, Microsoft Excel quits.

In addition, if you can open the workbook, it contains two worksheets named ***** (five asterisks) for which the visible property is set to xlveryhidden.

CAUSE

This problem occurs after you scan and clean Microsoft Excel workbooks with an antivirus software program. The problem occurs when the file becomes damaged while you are cleaning the workbook.

WORKAROUND

If you cannot open the workbook, please see the following article in the Microsoft Knowledge Base:

   Article-ID: Q142117
   TITLE     : Excel: Summary of Methods to Recover Data from Corrupted
               Files

If you can open the workbook, use either of the following methods to repair the damaged workbook.

Method 1: Copy Data to a New Workbook

Open the damaged workbook and follow these steps to recover the data:

  1. Open a new workbook.

  2. In the first worksheet in the damaged workbook, select the cells that contain data and click Copy.

  3. In the new workbook, paste the data into a worksheet.

    Repeat steps 1 through 3 for each worksheet in the damaged workbook.

  4. Save the new workbook as a new file.

Method 2: Remove the Damaged Worksheets

You can remove the problematic worksheets from your workbook by running the following Visual Basic for Applications procedure. The damaged sheets are hidden and named *****. Note that you cannot unhide and delete these manually without causing an invalid page fault.

IMPORTANT: Because Excel 97 cannot remove the corrupt files, you must run this procedure in either Excel version 5.0 or 7.0.

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 engineers 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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/

To use this macro, follow these steps:

  1. Start Excel 5.0 or 7.0 and open the damaged workbook. Point to Macro on the Insert menu, and click Module. Type the following macro:

          Sub CleanBook()
          Dim iCtr As Integer
          iCtr = 0
          For Each Sh In ActiveWorkbook.Sheets
              If Sh.Visible = xlVeryHidden Then
                  Sh.Visible = True
                  If InStr(Sh.Name, "*") > 0 Then
                      iCtr = iCtr + 1
                      Sh.Name = "NewSheet" & iCtr
                  End If
              End If
          Next Sh
          Call BadSheet
          MsgBox "Number of damaged sheets = " & iCtr
          Application.Dialogs(xlDialogSaveAs).Show
          End Sub
       
          Sub BadSheet()
          Application.DisplayAlerts = False
          For Each Sh In ActiveWorkbook.Sheets
              If InStr(Sh.Name, "NewSheet") > 0 Then
                  Sh.Delete
              End If
          Next Sh
          End Sub
    
    

  2. To run the macro, click Macro on the Tools menu. Click CleanBook and click Run.

  3. Save the recovered workbook as a new file.


Additional query words: XL97 XL7 XL5 asterisk PLDT97 PLDT Laroux E
corrupted corrupt
Keywords : xlgpf xlloadsave kberrmsg
Version : WINDOWS:5.0,5.0c,7.0,97
Platform : WINDOWS
Issue type : kbtshoot
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.