View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michel S. Michel S. is offline
external usenet poster
 
Posts: 33
Default Undefined User Defined Type at compile time

Not sure it was the problem but :

- I exported the last two modules I worked on
- I reimported them in a backup copy I made just before the edits I
made above

And now everything compile and works well..

Interesting things :

- After I imported the first file (a form with code behind), I tried a
compile and got the "Undefined User Defined Type" message again, but
this time, a code line was highlighted : a Dim variable AS
classInstance. That class was the second file I had not imported yet.

After importing the second file, not compile error at all.

Then I recalled that in the edits I made in the first place, one of
them was to change the class name, both the class module name (in its
properties sheet) and in the Dim and Set statements (AS class name) in
the other module.

These two modules are highly interrelated in that the class module
raise events that are sunken by the form module. The class module is
declared "WithEvents" in the form module.

Is it possible that VBA went confused by that change and corrupted my
project ?



Le 2007-03-18, Michel S. a supposé :
Thanks for your reply.

Unfortunately, I double-checked that every module has a "Option Explicit"
statement, eliminating this as a probable cause of my prob;em.

Still open to other suggestions.

RB Smissaert a présenté l'énoncé suivant :
If you haven't done it yet put Option Explicit at the top
of every module (normal modules, forms and classes)
and then compile again.

RBS

"Michel S." wrote in message
...
Hello,

Upon compiling a VBA Excel 2003 project, I get the message "Undefined User
Defined Type" in an Ok/Help box.

There's no highlighted code line at all to help me find where the compiler
found this.

I'm not using UDTs at all, and, AFAIK, all required librairies are
referenced, and none is maked as "Missing" in the references list.

Any idea on how to pinpoint the souce of this problem ?

Thanks