VBA question - Set reference to run Scripting.Dictionary

A

ajliaks

Hi

How do I set a reference to MS Scripting runtime in order to run
Scripting.Dictionary

Thanks
 
B

Bob Phillips

Go in to the VBE. Select Tools>References menu, and in the list box look for
an item called 'Windows Scripting Runtime, and check that item.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

in the VBE, Tools=>References, scroll down through the list until you see
Microsoft Scripting Runtime.
Click the checkbox and the click OK.

You should then see scripting in the object browser.

or use late binding (no reference required)

Sub Tester1()
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
dic.Add "ABCD", "Item1"
dic.Add "ABCE", "Item2"
MsgBox dic.Item("ABCD")

End Sub
 

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