cdiwindows
MIS
I have an Excel spreadsheet that I need to copy some of the data into Access. I found some code in this forum to copy it in, and it works fine on my machine.
When I copy the macro to another machine and get a Compile Error on the line 'Dim cn As ADODB.Connection'. The exact error is "Compile error: User-defined type not defined". I verified the references are the same.
Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=J:\Guest_Incidents.mdb;"
Set rs = New ADODB.Recordset
rs.Open "GuestIncident", cn, adOpenKeyset, adLockOptimistic, adCmdTable
What else should I check to get the code to compile?
Thanks
When I copy the macro to another machine and get a Compile Error on the line 'Dim cn As ADODB.Connection'. The exact error is "Compile error: User-defined type not defined". I verified the references are the same.
Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=J:\Guest_Incidents.mdb;"
Set rs = New ADODB.Recordset
rs.Open "GuestIncident", cn, adOpenKeyset, adLockOptimistic, adCmdTable
What else should I check to get the code to compile?
Thanks