Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2013, 08:26 AM
ky1488 ky1488 is offline Recover corrupted Excel 2007 file Windows 7 32bit Recover corrupted Excel 2007 file Office 2007
Novice
Recover corrupted Excel 2007 file
 
Join Date: Sep 2013
Posts: 6
ky1488 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 09-30-2013, 08:39 AM
BobBridges's Avatar
BobBridges BobBridges is offline Recover corrupted Excel 2007 file Windows 7 64bit Recover corrupted Excel 2007 file Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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
Reply With Quote
  #3  
Old 09-30-2013, 09:19 AM
ky1488 ky1488 is offline Recover corrupted Excel 2007 file Windows 7 32bit Recover corrupted Excel 2007 file Office 2007
Novice
Recover corrupted Excel 2007 file
 
Join Date: Sep 2013
Posts: 6
ky1488 is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 09-30-2013, 10:16 AM
BobBridges's Avatar
BobBridges BobBridges is offline Recover corrupted Excel 2007 file Windows 7 64bit Recover corrupted Excel 2007 file Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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.)
Reply With Quote
  #5  
Old 09-30-2013, 10:33 AM
ky1488 ky1488 is offline Recover corrupted Excel 2007 file Windows 7 32bit Recover corrupted Excel 2007 file Office 2007
Novice
Recover corrupted Excel 2007 file
 
Join Date: Sep 2013
Posts: 6
ky1488 is on a distinguished road
Default

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
Reply With Quote
  #6  
Old 10-01-2013, 02:21 PM
macropod's Avatar
macropod macropod is offline Recover corrupted Excel 2007 file Windows 7 32bit Recover corrupted Excel 2007 file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
With this approach, you'll be able to recover & edit the macro code as well.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

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
Recover corrupted Excel 2007 file 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft