DeleteVBACodeFromWorkbook

Sub DeleteVBACodeFromWorkbook( _
    wb As Workbook _
)
    Dim _
        vbc As VBComponent
    For Each vbc In wb.VBProject.VBComponents
        If vbc.Type <> vbext_ct_Document Then
            wb.VBProject.VBComponents.Remove vbc
        End If
    Next vbc
End Sub

Comments

Leave a Reply

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