PDA

View Full Version : Solved: VB Components



mdmackillop
01-12-2006, 03:54 PM
I can return the code name of sheets with the following. Is it possible to to get the sheet name as well?


For Each VBC In WB.VBProject.VBComponents
Set VBCM = VBC.CodeModule
Debug.Print VBCM.Name
Next

Bob Phillips
01-12-2006, 04:06 PM
Sub SheetNames()
Dim sSheet As String
Dim oVBMod As Object
Dim i As Long


With ActiveWorkbook.VBProject
For Each oVBMod In .VBComponents
Select Case oVBMod.Type
Case 100:
If oVBMod.Name <> "ThisWorkbook" Then
Debug.Print oVBMod.Name, oVBMod.Properties("Name")
End If
End Select
Next oVBMod
End With


End Sub

mdmackillop
01-12-2006, 04:35 PM
Thanks Bob.