Bug with For Each enumeration on x64 Custom Classes
问题 I have found a bug in VBA a few months ago and was unable to find a decent workaround. The bug is really annoying as it kind of restricts a nice language feature. When using a Custom Collection Class it is quite common to want to have an enumerator so that the class can be used in a For Each loop. This can be done by adding this line: Attribute [MethodName].VB_UserMemId = -4 'The reserved DISPID_NEWENUM immediately after the function/property signature line either by: Exporting the class