userform and error excel has stopped working

  • Thread starter Thread starter hekske
  • Start date Start date
H

hekske

hi,

i have created a userform in excel. when i debug it it works fine. when i
click on the button "Save" (does a save as) and rename the file until here no
problem. but when i try to open the newly saved file it gives an error like
"excel has stopped working ....". when i place a messagebox just before the
form.show command, it displays the messagebox and when the command form.show
needs to be executed the error appears again and i can close excel. if i open
de file without executing the code and change something (for exemple add an
empty line) in the code and save it, the file works again. like this i can
not send this userform to be used by our offices.
what could be the problem????? has anyone got an idea?
 
You need to put a break point at the SUB line in the userform and then step
through the code. You probably have to put a break point at the start of
each of the SUB's in the userform to find the problem.
 
Two more things. Change the Stop on Error mode in VBA tools - Options -
General - Error Stoppping. stop onj all errors. Also comment out all the ON
Error statements so you can find the source of the problem.
 
the version of excel is 2007 (12.06504.5001 sp2), the file size is 575 kb
there are no charts, formulas in the file. only some sheets (which contain
only text) and a userform (+ code).
how can i attach the file?
 
i put the error option to all errors but it stays the same. when i try to
debug, the error doesn't show. it only happens when i do a save (of the data
) and open the (new) file again (so that the code can be executed).
 
hi,

the code cleaner didn't solve the problem. i can not post the code because
there is a lot of code(modules, subs, ... ) behind the userform.

Cindy
 
Back
Top