#1
|
|||
|
|||
Recover corrupted Excel 2007 file
I have an Excel 2007 file with macros (xlsm), which Excel is unable to open, because it crashes in a routine on auto-open. How can I recover it? Would it be possible to disable VBA auto-open to get to the sheets? I have extracted the zipped file and am able to read sheet<n>.xml, but is there an easier way to recover the sheets?
Håkan |
#2
|
||||
|
||||
I jumped straight from Excel 2003 to 2010, and I've never used an auto-run macro. But it seems to me you just have tochange Excel's security settings so they won't try to run the auto-open macro, and then open the workbook. At that point, I expect Excel will warn you that there are macros in the workbook, and ask you whether to enable them. Leave them disabled, then go to the VBA editor and change the macro so it won't run automatically.
If you created the macro yourself, then at this point you can go back to running the macro manually, debugging until you figure out why it's not working properly. If you didn't create it, then of course you first want to make sure you want to run it at all. What if it's a virus? ...med vänliga hälsningar / Bob |
#3
|
|||
|
|||
Tack så mycket Bob, I already thought I had solved the problem that way, but still Excel won't open any worksheet - some of the modules are missing too. Probably I'm forced to rely on the extracted sheets.xml but how???
Håkan |
#4
|
||||
|
||||
I don't use XML, or at least I haven't so far, though I'm sure I will eventually. But if you've managed to extract XML worksheets, won't Excel read them directly? Then you can assemble them into a new workbook.
Would you care to post the bad workbook here? If there's nothing confidential in it, I'd be interested in taking a look to see whether I notice a possibility for rescue that I haven't thought of yet. And if nothing else works, I suggest you ask the XML question again, in a new thread so that someone else will pay attention to it. (Otherwise someone who knows the answer may glance at this and assume I'm helping you.) |
#5
|
|||
|
|||
A big step forward! I was able to recover the worksheets with Excel itself "Open and recover" I recovered the values - these are most important! However, I realized that a single backup wouldn't have helped at all, because the backup software would have copied the corrupted file too. Now I have to fix backup software to handle versions...
Rgds Håkan |
#6
|
||||
|
||||
Hi ky1488,
It's easy enough to work around the corrupt vba code by the following: • change the file extension from xlsm to zip • open the zip archive • delete the 'vbaProject.bin' file from within the zip archive • change the file extension back from zip to xlsm You'll lose all the macros, but all your data & formulae will be intact. Another option might be to use a macro to open the workbook, with its auto macros disabled. The following does that: Code:
Sub SafeOpen() Dim bSecState As Boolean With Application bSecState = .AutomationSecurity .AutomationSecurity = msoAutomationSecurityForceDisable With .FileDialog(msoFileDialogOpen) If .Show = -1 Then .Execute End With .AutomationSecurity = bSecState End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can Recovery The corrupted Excel File? | yu76uu | Excel | 1 | 11-06-2012 05:18 AM |
Can you recover an unsaved file? | Jay Kinetic | Word | 3 | 06-29-2011 01:07 AM |
Corrupted word file? | Konsolidering | Word | 0 | 02-21-2011 11:17 PM |
Recover File | nath9898 | PowerPoint | 1 | 05-10-2010 09:42 AM |
Excel file lost data how to recover it | zillah | Excel | 1 | 02-10-2010 08:36 PM |