Suddenly when I open my Excel file (contains VBA code), it always gives me an error.
The file has a Private Sub Workbook Open which contains some macros to run.
The "debug" yellow line not always stop at the same code line.
Even sometimes it gives me an error on a simple code something like
in one macro sub.![]()
Please Login or Register to view this content.
and after I delete that line of code, then it stops at another macro sub.
I've tried to delete all the macros to run in Private Sub Workbook Open.
Now I can open file, but then if I run any macro, it hangs forever..
so I have to use Task Manager "Processes" tab then kill Excel.Exe.
Say, the name of this problem file is Tiger.
While Excel app is close, I rename the file from "Tiger" to "Lion",
but it still either crash (hang forever) or give me error (which can be debugged).
I also have tried to SaveAs (after deleting the macros in Private Sub Workbook Open) the file as "Horse",
but it still the same problem after I open the "Horse" file.
Luckily, I have another file with the same macros with the problem file (but different data).
I can open this file without problem. Duplicate it and name the duplicate one to "Bird"....
open the problem file (after deleted the macros in Private Sub) then move the data to the "Bird" file.
Now I can open the "Bird" file without problem and all other macros (including the macros in the Private Sub) run without error.
BUT, after I rename the "Birds" to "Tiger", then the same problem back again.
I can't open the "Tiger" file as it gives me the same problem, either it hangs forever or gives me an error.
I need to have this file named "Tiger".
How do I resolve the problem ?
Any kind of help would be greatly appreciated.
Thank you in advanced.
Bookmarks