I realize this is really vague, but I thought it would be best to keep this as simple as possible as I first pose this question ...
Has anyone had repeated experience with Excel 2007 crashing and upon restarting, get a message that Excel found unreadable content in a workbook with a prompt to recover it--and then after asking to recover, get a message saying it can't be recovered because it is corrupt?
This happens to me fairly frequently. It does tend to happen more often when I'm working on an Excel project with a large amount of complex functions and/or VBA code. Currently though; I've been working on a project for someone else and initially was reusing the same workbook that has been in use for this application for a few years (is pretty huge--more than 100 sheets). Yesterday it crashed on me, prompted to recover and said it couldn't because it was corrupted. Since this workbook could have picked up who knows what over time, I started over with a fresh workbook, and when moving data and content from the old workbook to the new workbook I have been copying data only (paste special).
Right now I have only a few sheets and little data moved in, and a handful of VBA code, and it crashed on me when moving a cell (a merged cell that was originally 1x4)
I'm hoping to try and pinpoint if maybe it's my excel installation or not. Below is all of the code I have in the project right now. Currently there are no functions in the project that aren't in a VBA module. I have ten of the worksheets setup with tab names only (no data), and there is really only one sheet with data right now and it isn't much. Can't figure out why the workbook is getting corrupted...
Module 1:
Function GetDesktopPath() As String
Dim DskTop As String
Dim WSH As Object
'Uses special folder "Desktop" from Windows Script Host:
Set WSH = CreateObject("WScript.Shell")
DskTop = WSH.SpecialFolders("desktop")
GetDesktopPath = DskTop
'Free the object reference and allocated memory
Set WSH = Nothing
End Function
Module 2:
Sub Unhide()
'
'Unhide hidden worksheets
For Each Worksheet In ActiveWorkbook.Worksheets
Worksheet.Visible = True
Next Worksheet
End Sub
Sub Hide()
'
'Hide all worksheets except Src and DASHBOARD
Dim ws As Worksheet
For i = 1 To ActiveWorkbook.Sheets.Count
If Sheets(i).Name = "Src" Or Sheets(i).Name = "DASHBOARD" Then
' Do nothing
Else
Sheets(i).Visible = False
End If
Next i
Module 3:
Sub CopyOut()
ThisWorkbook.Sheets(CStr(ThisWorkbook.Sheets("DASHBOARD").Cells(6, 2).Value)).Visible = True
ThisWorkbook.Sheets(CStr(ThisWorkbook.Sheets("DASHBOARD").Cells(6, 2).Value)).Copy
ThisWorkbook.Sheets(CStr(ThisWorkbook.Sheets("DASHBOARD").Cells(6, 2).Value)).Visible = False
ActiveSheet.Name = ThisWorkbook.Sheets("DASHBOARD").Cells(6, 2).Value
ActiveSheet.Cells(2, 12).Value = ThisWorkbook.Sheets("DASHBOARD").Cells(1, 1).Value
ActiveSheet.Cells(4, 9).Value = ThisWorkbook.Sheets("DASHBOARD").Cells(16, 2).Value
Dim Status As String
Status = ThisWorkbook.Sheets("DASHBOARD").Cells(5, 3).Value
If Status = Trainee Then
ActiveSheet.Cells(4, 7).Value = ThisWorkbook.Sheets("DASHBOARD").Cells(5, 2).Value
Else
ActiveSheet.Cells(4, 6).Value = ThisWorkbook.Sheets("DASHBOARD").Cells(5, 2).Value
End If
ActiveWorkbook.SaveAs Filename:=GetDesktopPath & "\" & "WK " & ThisWorkbook.Sheets("DASHBOARD").Cells(1, 1).Value & " " & ThisWorkbook.Sheets("DASHBOARD").Cells(6, 2).Value
End Sub
Module 4:
Sub Standards()
Sheets("Office Standards").Visible = True
Sheets("Production Standards").Visible = True
Sheets("Production Standards").Select
End Sub
Sub ClsStandardsPROD()
Sheets("Production Standards").Visible = False
Sheets("Office Standards").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub ClsStandardsOFF()
Sheets("Office Standards").Visible = False
Sheets("Production Standards").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub CMatrix()
Sheets("Cell Matrix").Visible = True
Sheets("Cell Matrix").Select
End Sub
Sub ClsCMatrix()
Sheets("Cell Matrix").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub BPMatrix()
Sheets("Bus Protection Matrix").Visible = True
Sheets("Bus Protection Matrix").Select
End Sub
Sub ClsBPMatrix()
Sheets("Bus Protection Matrix").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub AuditorMinutes()
Sheets("Auditor Meeting Minutes 5-13-10").Visible = True
Sheets("Auditor Meeting Minutes 3-3-11").Visible = True
Sheets("Auditor Meeting Minutes 3-3-11").Select
End Sub
Sub ClsAuditorMinutesMAY()
Sheets("Auditor Meeting Minutes 5-13-10").Visible = False
Sheets("Auditor Meeting Minutes 3-3-11").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub ClsAuditorMinutesMAR()
Sheets("Auditor Meeting Minutes 3-3-11").Visible = False
Sheets("Auditor Meeting Minutes 5-13-10").Visible = False
Sheets("DASHBOARD").Select
End Sub
Sub ResetTabs()
'
'Hide all worksheets except DASHBOARD
Dim ws As Worksheet
For i = 1 To ActiveWorkbook.Sheets.Count
If Sheets(i).Name = "DASHBOARD" Then
' Do nothing
Else
Sheets(i).Visible = False
End If
Next i
End Sub
Any thoughts and ideas are welcome...thanks!
Bookmarks