Compile error when closing excel

  • Thread starter Thread starter kakou
  • Start date Start date
K

kakou

I've got a weird one here... :confused:

I have an excel sheet with vb controls - textboxes and combo boxes. I
put a bit of code behind one of the combo boxes to enable and disable a
few textboxes based on the value of combo box.

The code works perfectly, compiles, saves ... The problem happens when
I close the workbook: I get a compile error stating that the textbox
that I am enabling/disabling does not exist.

If I rename the textbox and adjust the code, I can close the workbook
only one time. The second time I get the same compile error.

I've tried replacing the textboxes, with new names, and the same thing
happens again.

What is triggering the compile on the exit of the workbook? Why would
the text boxes only be unrecognized on exit?

Any help would be much appreciated!
 
The problem happens when
I close the workbook: I get a compile error stating that the textbox
that I am enabling/disabling does not exist.

What version of Excel are you using?

Old versions had a habit of putting extra cruft into the VB portion of the
workbook that could make things go weird.

The only solution is to rebuild the workbook from scratch. (You can copy
over pieces, of course.)
 
Back
Top