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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.Connection in Excel 1

Status
Not open for further replies.

Rydel

Programmer
Feb 5, 2001
376
CZ
The first line of my subroutine in Excel VBA module is the declaration of the ADODB.Connection:

Code:
Dim con As New ADODB.Connection

And it stops there with an error message:

User-defined type not defined

Strangely enough, I have a very similar Sub in another Excel file which start with exactly the same declaration and it works. Any help is greatly appreciated!!! ---
---
 
You need to set a Reference to to the ADO dll file. Go to Tools / References. Scroll down to "Microsoft ActiveX Data Objects 2.5" and check the checkbox next to the name. That's it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top