View Single Post
 
Old 10-01-2013, 02:21 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit 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