Hi
I've created a dictionary, and then converted that dictionary into an array.
I am trying to retrieve the Item for the dictionary using a known Key.
I have used the code:
where avKeys is a Variant and dict is a Dictionary.
I am attempting to use a string (sSearchTerm) to return the Item, and:
avKeys(1) = aSearchTerm (say "1456.txt" (avKeys(1)) = "1456.txt" (aSearchTerm))
However,
but
What am I missing if avKeys(1) = aSearchTerm (I've even tested it via the following:
Any help greatly appreciated.
Cheers
pvr928
I've created a dictionary, and then converted that dictionary into an array.
I am trying to retrieve the Item for the dictionary using a known Key.
I have used the code:
Code:
avKeys = dict.Keys
where avKeys is a Variant and dict is a Dictionary.
I am attempting to use a string (sSearchTerm) to return the Item, and:
avKeys(1) = aSearchTerm (say "1456.txt" (avKeys(1)) = "1456.txt" (aSearchTerm))
However,
Code:
Debug.Print dict(avKeys(1)) = 2
but
Code:
Debug.Print dict(aSearchTerm) = [Empty]
What am I missing if avKeys(1) = aSearchTerm (I've even tested it via the following:
Code:
If avKeys(1) = aSearchTerm Then
MsgBox "True"
Else
MsgBox "False"
End If
Any help greatly appreciated.
Cheers
pvr928