View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
bmolintas bmolintas is offline
external usenet poster
 
Posts: 6
Default Command Button Click

I want to assign the following code to a button on my Excel 2003 spreadsheet.
When I click the button, I receive a Microsoft Visual Basic Error "Compile
Error: User-defined type not defined"

Dim Con As New ADODB.Connection
Dim Cmd As New ADODB.Command
Dim Cmd2 As New ADODB.Command
Dim Rs As ADODB.Recordset

Con.Open "DSN=KIAMOTOR;"
Set Cmd.ActiveConnection = Con
Cmd.CommandText = "SELECT * FROM PTFGRPP"

Thanks in advance for the help.