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
 
Top