I’ve uploaded a new version of the Dictionary Class and a helper KeyValuePair Class. This exposes the KeyValuePairs collection so iteration is now very fast, about 2 seconds to iterate 1 million items using a for each loop:
dim oKeyValuePair as KeyItemPair For Each oKeyValuePair In td.KeyValuePairs ' direct access to collection var = oKeyValuePair.Value 'either of .key,.value Next
Updated 25-Nov-11: The need for the helper class is to allow updates to the .Item without changing the order. 23-Oct-2018: KeyValuePair.cls updated. 09-Apr-2021: above two links refreshed.