Hi,
I am trying to get an Excel sheet to read/write to an Access DB. My code starts as shown below.
When running it, I get the error: "Compile error. User-defined type not defined" - it crashes on the "Dim cnn As ADODB.Connection" line. I also notice that while String and Integer are syntax highlighted in blue, Range, ADODB.Connection and ADODB.Recordset remain black. I am guessing that my VB doesn't know how to interpret the ADODB commands.
In tools-references, Microsoft DAO 2.5/3.51 compatability library is selected.
Any thoughts on how to solve this would be welcome.
Lotte
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DBFullName As String
Dim TableName As String
Dim TargetRange As Range
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim intColIndex As Integer
DBFullName = "Qa.mdb"
TableName = "Tasks"
TargetRange = "A3"
...
Bookmarks