MyTetra Share
Делитесь знаниями!
Время создания: 16.03.2019 23:43
Раздел: Разные закладки - VBA - VBA управление кодами
Запись: xintrea/mytetra_db_adgaver_new/master/base/1512843770t5v7lbqulr/text.html на raw.githubusercontent.com

Public Sub ExportSourceFiles(destPath As String)

Dim component As VBComponent

For Each component In Application.VBE.ActiveVBProject.VBComponents

If component.Type = vbext_ct_ClassModule Or component.Type = vbext_ct_StdModule Then

component.Export destPath & component.Name & ToFileExtension(component.Type)

End If

Next

End Sub

Private Function ToFileExtension(vbeComponentType As vbext_ComponentType) As String

Select Case vbeComponentType

Case vbext_ComponentType.vbext_ct_ClassModule

ToFileExtension = ".cls"

Case vbext_ComponentType.vbext_ct_StdModule

ToFileExtension = ".bas"

Case vbext_ComponentType.vbext_ct_MSForm

ToFileExtension = ".frm"

Case vbext_ComponentType.vbext_ct_ActiveXDesigner

Case vbext_ComponentType.vbext_ct_Document

Case Else

ToFileExtension = vbNullString

End Select

End Function

Так же в этом разделе:
 
MyTetra Share v.0.65
Яндекс индекс цитирования