Solved

for each... in ...  loop

Posted on 1998-12-17
2
150 Views
Last Modified: 2010-05-03
i am using this code within a class (called BLUBs)
This class holds a collection with objects of type BLUB in it.

Public Property Get NewEnum() As IUnknown
    Set NewEnum = myCollection.[_NewEnum]
End Property

Now code like this should work (Object XX already initialized)
dim XX as BLUBs
dim X as BLUB

for each X in XX
   ...
I get a runtimeerror. Object does not support this property.
0
Comment
Question by:tstrob
2 Comments
 
LVL 1

Author Comment

by:tstrob
Comment Utility
Edited text of question
0
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
Comment Utility
Employees.cls, somewhere in your samples directory:
' NewEnum method enables the use of For
' -------       Each with the Employees
'   collection class.  For an
'   explanation, see "Creating Your Own
'   Collection Class: The House of Bricks"
'   in Books Online.
'
' For NewEnum to work properly, its
'   procedure ID must be set to -4.  To see
'   this, select Procedure Attributes
'   from the Tools menu.  In the Name box,
'   select Item, then click the Advanced
'   button.  You can see that the Procedure
'   ID has been set to -4.  ("Hide this
'   member" is checked, also, so that the
'   NewEnum method is hidden in the Object
'   Browser.)

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now