Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User defined type not defined ?? Excel VBA

Status
Not open for further replies.

nslemmons

Technical User
Mar 30, 2006
7
US
Hi everyone,
I copied a handful of functions to get data from a group of Excel workbooks in a directory I defined in the code. I'm not really good with VBA so I'm stumped pretty easily when something like this happens. Below is the code snippet.

Code:
Public Sub GetData(SourceFile As Variant, SourceSheet As String, _
                   sourceRange As String, TargetRange As Range, HeaderRow As Boolean)

    ' Changed on 20-Oct-2005
    Dim rsData As ADODB.Recordset
    Dim szConnect As String
    Dim szSQL As String
    Dim lCount As Long

The "ADODB.Recordset" is what is highlighted when the error occurs. Any help is appreciated.

Thanks,
Nate
 
you need to set a reference to ADO in Tools>References within the VBE

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top