Search code examples
vbaexcelxlsm

Find vba code from an excel file did not open


I have my code in an excel file but the problem that I can't open this file. What can I do in this case? It's in 100% and I wait and it doesn't like to be opened. enter image description here

enter image description here


Solution

  • I am not really sure if this is going to help. But I was unable to post this "picture" in a comment. Hence, I am posting it as a possible solution to your problem:

    enter image description here

    1. Open Excel and go to the VBE (Developer Tab --> Macros)
    2. Open the Immdediate Window in the VBE
    3. Type in the command as given below (make sure to change the path and file name as necessary) and confirm by pressing return.

    The file should now open in read only mode and a small window should notify you that Excel attempted to repair the file while opening it.

    Workbooks.Open FileName:="C:\tmp\ProblematicFile.xlsm", UpdateLinks:=False, ReadOnly:=True, CorruptLoad:=xlRepairFile