Hi Tim,
I've just downloaded the latest VBA-Dictionary-master.zip.
1) When I open VBA-Dictionary Specs.xlsm and click on Run Specs, I get Error 5 on this line
dict_pDictionary.CompareMode = Value
in Public Property Let CompareMode. Here's the call stack:
At this point dict_pDictionary.Count is 1.
So I tried stepping through the code and found something that seems strange. In AllSpecs(), at the first call to CreateDirectionary(UseNative), with UseNative=False:
Public Function CreateDictionary(Optional UseNative As Boolean = False) As Object
If UseNative Then
Set CreateDictionary = CreateObject("Scripting.Dictionary")
Else
Set CreateDictionary = New Dictionary
End If
End Function
2) If UseNative is true, this returns a Scripting.Dictionary. If UseNative is False, it returns a new (VBA-)Dictionary. But the compiler constant UseScriptingDictionaryIfAvailable is True, which means that (in Windows) VBA-Dictionary uses a Scripting.Dictionary - IOW, it appears, your test code doesn't test the class.
To overcome this I set UseScriptingDictionaryIfAvailable=False. This leads to compile errors, starting with an undeclared variable Key in dict_AddKeyValue().
Hi Tim, I've just downloaded the latest VBA-Dictionary-master.zip. 1) When I open VBA-Dictionary Specs.xlsm and click on Run Specs, I get Error 5 on this line
in
Public Property Let CompareMode
. Here's the call stack:At this point
dict_pDictionary.Count
is 1.So I tried stepping through the code and found something that seems strange. In
AllSpecs()
, at the first call toCreateDirectionary(UseNative)
, withUseNative=False
:2) If
UseNative
is true, this returns a Scripting.Dictionary. IfUseNative
is False, it returns a new (VBA-)Dictionary. But the compiler constantUseScriptingDictionaryIfAvailable
is True, which means that (in Windows) VBA-Dictionary uses a Scripting.Dictionary - IOW, it appears, your test code doesn't test the class.To overcome this I set
UseScriptingDictionaryIfAvailable=False
. This leads to compile errors, starting with an undeclared variableKey
indict_AddKeyValue()
.Windows 7, Excel 2010
Over to you!
John