Hi all,
I am trying to figure out what interface For Each expects. My reason for thinking it is actually looking for one is that the following will work fine:
but this will error:
with the message "Class does not support Automation or does not support expected interface". But what interface?
What I am talking about is basically the rough equivalent of testing for IEnumerable (which the mscorlib objects obviously have in some cases)
I am trying to figure out what interface For Each expects. My reason for thinking it is actually looking for one is that the following will work fine:
Code:
Dim item As Variant
Dim test As New [COLOR=#ff0000][B]Collection[/B][/COLOR]
For Each item In test
Exit For
Next item
but this will error:
Code:
Dim item As Variant
Dim test As New [COLOR=#ff0000][B]Chart[/B][/COLOR]
For Each item In test
Exit For
Next item
What I am talking about is basically the rough equivalent of testing for IEnumerable (which the mscorlib objects obviously have in some cases)