Whay i am trying to do is loop through the collection of VB components in the activeworbook VBproject.
I can loop through the currently active code panes in the workbook using the following code:
but i need to scan iterate through all vbcomponents in a vbproject. Please help.Code:Sub main() On Error GoTo err_handle Dim vbp As VBProject Dim vbc As Codepane Dim appMsExcel as new excel.application appMsExcel.Visible = True appMsExcel.Workbooks.Open "c:\locallinktools\linktools.xls" appMsExcel.Workbooks("linktools.xls").Activate debug.print appMsExcel.activeworkbook.vbprojet.vbe.codepanes.count For Each vbc In appMsExcel.activeworkbook.vbprojet.vbe.codepanes MsgBox vbc.codemodule Next


Reply With Quote