Microsoft KB Archive/179373

= File Is Damaged After It Is Cleaned by Antivirus Software =

Article ID: 179373

Article Last Modified on 8/17/2005

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition

-



This article was previously published under Q179373





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:

142117 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.
 * 1) 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 modules, 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. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to 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 requirements. To use this macro, follow these steps:

  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  To run the macro, click Macro on the Tools menu. Click CleanBook and click Run. Save the recovered workbook as a new file.

Additional query words: XL97 XL7 XL5 asterisk PLDT97 PLDT Laroux E corrupted corrupt XL

Keywords: kberrmsg kbprb kbdtacode KB179373

-

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

© Microsoft Corporation. All rights reserved.