If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Iterate Code Modules

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-28-09, 05:58
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Iterate Code Modules

Hi

In Access there is a Modules container and Module objects that can be iterated, read from and written to. Doesn't seem so in Excel - is this correct please?

Thanks
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #2 (permalink)  
Old 10-28-09, 06:20
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 477
Hi,

I don't use this part of the object model very often....

A CodeModule belongs to a VBComponent object which can be referenced via the VBComponents object collection. For early binding a reference to the Microsoft VBA Extensibility library is required:
Code:
Sub foo()

    Dim vbc As VBIDE.VBComponent
    
    For Each vbc In ThisWorkbook.VBProject.VBComponents
        Debug.Print vbc.Name
        'vbc.CodeModule....
    Next vbc
    
End Sub

There's lots of examples and a good explanation of the hierachy at Chip Pearson's site:
Programming In The VBA Editor
Reply With Quote
  #3 (permalink)  
Old 10-28-09, 06:48
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Lol - I almost addressed my question directly to you

Thanks again Colin - I will have a nose.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #4 (permalink)  
Old 10-28-09, 07:05
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 477
lol.... keep 'em coming...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On