Corrupted Excel File

Hi there,

We have an Excel file that has become corrupted and even when trying to repair itself an error is produced.

Here is the error:

Error
I am looking for some guidance with regards to repairing the file manually or through known Excel Recovery Software tools that are affective.

Thanks,
SpaceLaika.
SpaceLaikaAsked:
Who is Participating?
 
redmondbConnect With a Mentor Commented:
Hi, SpaceLaika.

A few questions, please...
(1) On the off chance that the data isn't confidential, please post the data here.
(2) I'm not clear - does the file open after the repair? If so, please do the following...
    (A) With the corrupt file as the active workbook, run the following code to count the no. of shapes...
Sub getShapeCount()
Dim xSheet As Worksheet
Dim xHold As String
Dim xCount As Long

For Each xSheet In ActiveWorkbook.Worksheets
    xHold = xHold & xSheet.Shapes.count & Chr(9) & xSheet.name & Chr(13)
    xCount = xCount + xSheet.Shapes.count
Next

MsgBox ("Total = " & xCount & Chr(13) & Chr(13) & xHold)

End Sub

Open in new window

   (B) Assuming that the result is "reasonable" (hundreds rather than, as sometimes, hundreds of thousands), please run the following and post its output here...
Sub List_Shape_Details()
'List of buttons/shapes/pictures on all sheets in the active workbook.
'based on Shawn Foley, programming group, 1999-09-10
            '-- http://groups.google.com/groups?as_umsgid=7rbk95%24b44%241%40nntp8.atl.mindspring.net
Dim wks As Worksheet
Dim shp As Shape
Dim nRow As Long

Sheets.Add

ActiveSheet.Range("A1:R1").Value = Array("Worksheet", "Shape", "Type", "OnAction", "Hyperlink", "TopLeft", "BotRight", "Height", "Width", _
                                         "Autoshape Type", "Form Control Type", "Index", "ID", "Text", "Formula", "Obj. ProgID", "Obj. Value", "Obj. Ticked?")
nRow = 1

Application.ScreenUpdating = False
On Error Resume Next   'hyperlinks, topLeftCell, BottomRightCell
    
    For Each wks In ActiveWorkbook.Worksheets
        
        For Each shp In wks.Shapes
            If shp.name = "Control 2" Then Stop
            nRow = nRow + 1
            Cells(nRow, 1) = "'" & wks.name
            Cells(nRow, 2) = shp.name
            Cells(nRow, 3) = shp.Type
            Cells(nRow, 4) = shp.OnAction
            Cells(nRow, 5) = shp.Hyperlink.Address
            Cells(nRow, 6) = shp.TopLeftCell.Address(0, 0)
            Cells(nRow, 7) = shp.BottomRightCell.Address(0, 0)
            Cells(nRow, 8) = shp.Height
            Cells(nRow, 9) = shp.Width
            Cells(nRow, 10) = shp.AutoShapeType
            Cells(nRow, 11) = shp.FormControlType  'i.e.  autofilter button is 2
            Cells(nRow, 12) = shp.Index
            Cells(nRow, 13) = shp.ID
            Cells(nRow, 14) = shp.TextFrame2.TextRange.text
            Cells(nRow, 15) = shp.DrawingObject.Formula
            Cells(nRow, 16) = shp.OLEFormat.Object.progID
            Cells(nRow, 17) = shp.OLEFormat.Object.Object.Value
            Cells(nRow, 18) = shp.OLEFormat.Object.Object.Checked
        Next shp
    
    Next wks
    
On Error GoTo 0
Application.ScreenUpdating = True

End Sub

Open in new window

Thanks,
Brian.
0
 
arrorynCommented:
Does this allow you in to the file?

1. Right click on the Excel file.
2. Go to Properties.
3. In General tab, at the bottom there is an area called Security, click on Unblock
0
 
arrorynConnect With a Mentor Commented:
Alternatively, if you have Excel 2003 available to you:

1. Open the file in Excel 2003
2. Go to File: Save
3. Change the Save As type to Web Page (.html), save and close the file
4. Open the .html file in Excel
5. Save the file as a .xls (with a new name so the original isn't lost
0
 
SpaceLaikaAuthor Commented:
Thank you for the help. This question was asked on behalf of some collegues of mine which have since discovered a temporary workaround, whereby they are now saving the file in binary format in Excel 2010 .xlsb which allows them to open the file and continue to work in it. The format is VBA and Macro enabled.
0
 
redmondbCommented:
Thanks, SpaceLaika.

As you quite rightly pointed out, this may only a temporary solution as the binary rebuild, while encouraging, is no guarantee that the corruption is gone. Please feel free to remove all confidential information from the original version and post it here.

Regards,
Brian.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.