LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default User-defined type not defined

A UDT is not a typelib! Typelibs require a reference; UDTs require
definition same as variables do.

"User-defined type not defined" error suggests you're passing a ref to
a UDT that doesn't exist. For example...

Type udtMyType
My1 As Boolean: My2 As Long: My3 As String
End Type
Public MyType As udtMyType

...and somewhere in code you'd use these like this...

Sub InitGlobals
MyType.My1 = ThisWorkbook.Saved
If MyType.My1 Then
MyType.My2 = 1: MyType.My3 = "Yes"
Else
MyType.My2 = 0: MyType.My3 = "No"
End If
End Sub

...where this will compile without error. Note that as soon as you type
"MyType." intellisense displays the list of types as defined in your
Type declaration.

Trying to compile 'MyType.My0' will throw an error!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
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
Compile error: User-defined type not defined Ayo Excel Programming 3 April 23rd 09 07:42 PM
"User-defined type not defined" message in Excel RW1946 Excel Discussion (Misc queries) 0 August 31st 05 12:14 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 02:52 AM.

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

About Us

"It's about Microsoft Excel"