Have a look at the following link and see if it helps. Note that it is a non Microsoft site but is a popular site for Excel Users.
VBA code missing from Excel Workbook
Hi Microsoft community,
I have been working on a macro-enabled workbook. Today when opening the sheet, I get this error for each module:
After pressing "ok" for each "missing module" I get this error:
When accessing Visual Basic I can se the modules in the project explorer, but they are all empty?
I have selected the "BiomassSetup" module in the picture below:
If the file can't be fixed, is it then possible to get my code back?
Hope that you guys can help. It's approximately a weeks coding I'm missing...
Microsoft 365 and Office | Excel | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
6 answers
Sort by: Most helpful
-
-
-
Anonymous
2021-09-06T06:40:26+00:00 Thank you Ossie Mac. Do you know what is ment with the "I go to vb code screen and write in Stop in first line of workbook open procedure". I find this part confusing.
-
Anonymous
2021-09-06T06:45:25+00:00 I tried this. But this wasn't the issue. I noticed that the file went from 450 kb to 6 Mb later that day. The file was definetly corrupt. I had the file on sharepoint, but all previeous versions had the same error. Then at the end of the day, I accessed the sharepoint through my browser, and downloaded a version. This version worked. I have no idea of what happened... Thank you for your help! I'm always learning and am greatful for the link you send. I'm definitetly gonna check out the forum.
Best regards,
-
OssieMac 47,981 Reputation points Volunteer Moderator2021-09-06T07:01:46+00:00 Do you know what is meant with the "I go to vb code screen and write in Stop in first line of workbook open procedure". I find this part confusing.
It was assuming that you have a workbook Open event. The Stop simply stops the code from continuing to run past that point. The VBA editor should open with the Stop line highlighted. If you click the Reset button then that stops all of the code and the workbook has then opened without the Workbook Open code running.
However, if you now have a downloaded version of the workbook with the code running satisfactorily then corrupted workbook is more likely the problem you were having.