I get the compile-time error \"User-defined types not defined\" on this line:
Dim cn As ADODB.Connection
What could be wrong?
Code:
I tried adding Microsoft ActiveX Data Objects 2.5 and 2.8 library, but it did not work out. But when I tried creating new object like below it worked.
Set cn = CreateObject("ADODB.Connection")