Scripting.Dictionary

G

Guest

Can anyone help, I am getting this error. Thank you!

***Compile Error
***User Defined not type Defined

Private Sub LoadMares()
Dim mares As New Scripting.Dictionary ***(THIS IS HIGHLIGHTED)
Dim index As Long
Dim Mare As String
For index = 2 To Source.Rows.Count
Mare = Source.Cells(index, 1)
If Not mares.Exists(Mare) Then
mares.Add Mare, Mare
cmbMare.AddItem Mare
End If
Next


End Sub
 
P

paul.robinson

Hi
You need to set a reference (in Tools) to the Microsoft Scripting
Runtime library (which is not part of Excel VBA, hence the error)
regards
Paul
 
B

Bob Phillips

See response to earlier post in this group.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top