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

ID: Q179373


The information in this article applies to:


SYMPTOMS

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

This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor.
When you click Details, you receive an error message similar to either of the following:
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:

Q142117 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-3 for each worksheet in the damaged workbook.


  4. Save the new workbook as a new file.


Method 2: Remove the Damaged Worksheets (Excel 5.0 or 7.0 Only)

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 corrupted 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 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 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/support/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          : kberrmsg kbdta kbdtacode xlloadsave xlgpf 
Version           : WINDOWS:5.0,5.0c,7.0,97
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 8, 1999