Excel macro code disappeared

  • Thread starter Thread starter Poshi
  • Start date Start date
P

Poshi

Hi!

Yesterday I created a Macro in Excel 2007 that consists of 1 user form and 5
modules. I used a million times, but today, when I open the xlsm file all the
code in the modules was gone! The user form is there, but everything else
just disappeared!

Can some help me please? I'm desperate!!!!

Thanx!
 
Hi,

Can't say for sure. But did you save the file? When you are on the VBA
side you have to be careful which file Excel is actually saving - for
example, you may be in the code area for Workbook1, but in the Project window
you are on Workbook2, when you click Save, which file gets saved? You can
tell by placing your mouse over the Save button and viewing the ToolTip.

Maybe the code is there but your looking in the wrong place? Userform code
is not stored in a regular module, it is the userforms module. Double-click
the user form and see if you find anything.

Is it possible you have more than one copy of the file? With code in one
and not the other?

Of course if its gone, there isn't anything one can do except recreate it.
 
Back
Top