Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Undefined User Defined Type at compile time

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Undefined User Defined Type at compile time

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Undefined User Defined Type at compile time

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Undefined User Defined Type at compile time

It sounds you need the CodeCleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm

RBS

"Michel S." wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Undefined User Defined Type at compile time

Thanks !

It took a couple of retries (Excel crashed when modules were exported
in the same directory as the xls file), but it finally cleaned the
project correctly since there are no longer suspect compile errors.

Thanks again !
MS

RB Smissaert a exposé le 2007-03-19 :
It sounds you need the CodeCleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm

RBS

"Michel S." wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Workspace faux user-defined type not defined Chris S[_2_] Excel Programming 3 November 11th 04 05:51 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
Word.Document - user defined type not defined jowatkins[_7_] Excel Programming 0 January 20th 04 08:46 AM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"