VBComponentNameIsUnique

VBComponentNameIsUnique

Public Function VBComponentNameIsUnique( _
    wb As Workbook, _
    strInputName As String _
) As Boolean
    Dim vbc As VBComponent
    VBComponentNameIsUnique = True
    For Each vbc In wb.VBProject.VBComponents
        If vbc.Name = strInputName Then
            VBComponentNameIsUnique = False
        End If
    Next vbc
End Function

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *