Leon
Leon

Reputation: 35

VB (macro in excel) - compile error

i am try to create an uploader in excel using vb (macro) to store data in an access database. i believe in terms of the script everything is ok. its just that when i run the upload it gives me the error Compile error - User-Defined type not defined and once i click on OK it highlights the part where it finds the error which is:

Private Sub Upload_Click() <------ this part!!!! 
Dim cs As ADODB.Connection 
Dim rs As ADODB.Recordset 
Dim ServerName As String 
Dim DatabaseName As String 
Dim TableName As String 
Dim UserID As String 
Dim Password As String

can anybody help me make this work....

Upvotes: 0

Views: 541

Answers (1)

Crispy
Crispy

Reputation: 5637

You need to add the reference Microsoft ActiveX Data Objects 2.0 Library'

Menu Item: Tools/References

Upvotes: 2

Related Questions