I am trying to use VBA to pull data from Access into Excel using MS Query. I found a good bit of code to use in doing this here: http://www.excelguru.ca/node/23
However, when I paste this code into my module and then make the path modifications to use the database I'm working with, I get an error when I run the code. The error is: "Compile Error: User-defined type not defined" and it highlights the first dim statement "Dim cnt As New ADODB.Connection". If I take out that statement, it also doesn't like the second.
I'm not really sure how to check for Microsoft ActiveX Data Objects 2.x Library that is apparently necessary for the code to work.
I'm running Excel 2000.
Any help would be greatly appreciated.
However, when I paste this code into my module and then make the path modifications to use the database I'm working with, I get an error when I run the code. The error is: "Compile Error: User-defined type not defined" and it highlights the first dim statement "Dim cnt As New ADODB.Connection". If I take out that statement, it also doesn't like the second.
I'm not really sure how to check for Microsoft ActiveX Data Objects 2.x Library that is apparently necessary for the code to work.
I'm running Excel 2000.
Any help would be greatly appreciated.