I am trying to create a dictionary object in a Visual Basic Macro running in Excel. The VB Help shows this example for creating and populating the object:
Dim d 'Create a variable
Set d = CreateObject(Scripting.Dictionary)
d.Add "a", "Athens" 'Add some keys and items
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
Whenever I try this (I have even pasted the above example directly into my subroutine), I get a "runtime error '424': Object required" error on the "Set d = ..." line.
What am I doing wrong? I have not been able to find anything in the help screens that will tell me.
Dim d 'Create a variable
Set d = CreateObject(Scripting.Dictionary)
d.Add "a", "Athens" 'Add some keys and items
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
Whenever I try this (I have even pasted the above example directly into my subroutine), I get a "runtime error '424': Object required" error on the "Set d = ..." line.
What am I doing wrong? I have not been able to find anything in the help screens that will tell me.