Solved

for each... in ...  loop

Posted on 1998-12-17
2
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Author Comment

by:tstrob
ID: 1451124
Edited text of question
0
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
ID: 1451125
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

688 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