Macro Recovery

Sori

New Member
Joined
Jan 3, 2005
Messages
11
Hello,
I have an excel file with lots of macro and forms.As I try to open it, an excel faiulre appears and the file can not be open. I have search in the web for a recovery software but they only recover the sheets nor the VB modules.

Does anyone know how to recover the macros???? I have no problem if i lost the sheets and even the forms.


Thanks in advance and best regards
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Here is some code that worked for me when I was trying to copy a macro from a template. However if your unable to open the file this may not work. If you can give more information, perhaps the exact error your recieving it might help.
Tyler
Code:
Sub CopyAllModules()

Dim FName As String
Dim VBComp As VBIDE.VBComponent

With Workbooks("Book2")
    FName = .Path & "\code.txt"
    If Dir(FName) <> "" Then
        Kill FName
    End If
    For Each VBComp In .VBProject.VBComponents
        If VBComp.Type <> vbext_ct_Document Then
           VBComp.Export FName
           Workbooks("book1").VBProject.VBComponents.Import FName
           Kill FName
        End If
    Next VBComp
End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top