View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default User defined Type

try changing
Dim Excel(1 To 3) As UserDefinedType
to
Dim udtExcel(1 To 3) As UserDefinedType

Same deal with ADODB. Both Excel and ADODB are reserved so you don't really
want to use them as variable names...
--
HTH...

Jim Thomlinson


"Trebor" wrote:

I am trying to debug existing code and the following declaration won't work.

Private x2App As Excel.Application

I keep getting an error msg stating "user defined type not defined"

Here is the Type statement I have in the declaration section of my class
module.

Private Type UserDefinedType
Application As Object
Workbook As Object
Worksheet As Object
End Type

Private Type UserDefinedType2
Connection As Object
Command As Object
Parameter As Object
Recordset As Object
End Type

Option Explicit
Dim Excel(1 To 3) As UserDefinedType
Dim ADODB(1 To 19) As UserDefinedType2

Any solutions?
--
TWN