vba error 424 with Collection of Objects -


i working on building , referencing collection of custom objects. class called cproject, , have 2 properties of name , refnum.

the code create , reference looks this:

dim projects collection  sub buildprojects()       dim integer       set projects = new collection    each c in worksheets("active projects").range("a4:a750").cells     if isempty(c)          'do stuff      else         if projects.count > 0            = 1 projects.count                 if c.value = projects.item(i).name '<---error occurs here                      'do duplicate management stuff                  end if             next         end if     end if next end sub 

when run code error 424: object required. believe providing qualified object identifier. out there see have made mistake?

the collection items variant types, can change this:

dim projects collection  sub buildprojects()       dim integer       dim var_item variant       dim acproject cproject        set projects = new collection    each c in worksheets("active projects").range("a4:a750").cells     if isempty(c)          'do stuff      else         each var_item in projects             set acproject = var_item             if c.value = acproject.name                   'do duplicate management stuff              end if         next      end if next end sub 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -