View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond[_2_] Robin Hammond[_2_] is offline
external usenet poster
 
Posts: 575
Default Dictionary Object in Windows XP

Alan,

Not sure about this specific reference, but it's just possible that the
class id has changed during the Windows upgrade. Try removing the reference
then browse to the specific file and add it back in again. If that doesn't
work, late binding might fix the problem. Much of the time we use early
binding - i.e. setting a reference as you have - during any development
stage, then late binding for deployment in case something changes in future
with a class reference.

Robin Hammond
www.enhanceddatasystems.com

"Alan Beban" wrote in message
...
I previously ran the following code in xl2000, Windows98

Sub AB1()
Dim x As Dictionary
Dim arr(1 To 11, 1 To 1), arr2
arr = Range("A1:A11")
Set x = New Dictionary
On Error Resume Next
For Each Elem In arr
x.Add Item:=Elem, key:=CStr(Elem)
Next
On Error GoTo 0

'Load a 0-based horizontal array with the unique
'elements from the Dictionary Object
arr2 = x.Items
End Sub

I upgraded to WindowsXP and am still running xl2000. In my file with the
above code, in the VBE, clicking Tools|References shows that Microsoft
Scripting Runtime is available (i.e., it is included in the list and has a
checkmark alongside it). The above code, though, produces an error message
at the first line--Can't find project or library.

What am I doing wrong?

Thanks in advance,
Alan Beban