excelvbafile-recovery

Recover excel changes


I was using a excel file with macro (*.xlsm), and after a entire day without saving I saved as a common excel file (*.xlsx) and closed everything, and now I have a old xlsm and a new xlsx.

There is any way I can recover the code? I really make a lot of changes and as I saved the file in xlsx I don't think that excel will give me a early version of my coded file.


Solution

  • Not answering your question (you already got the bad news...) but I have this code in my personal Macro Workbook and linked to an icon on the Excel Quick Access Toolbar:

    Public Sub SaveSnapshot()
    
        Dim fso As New Scripting.FileSystemObject
        Dim wb As Workbook, p As String
        Set wb = ActiveWorkbook
    
        p = wb.Path & "\Snapshots"
    
        If Not fso.FolderExists(p) Then fso.CreateFolder (p)
    
        wb.Save
        wb.SaveCopyAs p & "\" & Format(Now, "yyyymmdd_hhmmss") & "_" & wb.Name
    
    End Sub
    

    I get in the habit of clicking that icon regularly...