You've already forked excel-addins
Added sourcecode
This commit is contained in:
Binary file not shown.
32
src/DevelopmentHelper.bas
Normal file
32
src/DevelopmentHelper.bas
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Attribute VB_Name = "DevelopmentHelper"
|
||||||
|
Option Explicit
|
||||||
|
|
||||||
|
Sub ExportVbaModules()
|
||||||
|
Dim j As Integer
|
||||||
|
Dim strSourcePath As String
|
||||||
|
Dim ext As String
|
||||||
|
Dim fileName As String
|
||||||
|
|
||||||
|
strSourcePath = ActiveWorkbook.Path & "\src"
|
||||||
|
If Dir(strSourcePath, vbDirectory) = vbNullString Then MkDir strSourcePath
|
||||||
|
|
||||||
|
For j = 1 To ActiveWorkbook.VBProject.VBComponents.Count
|
||||||
|
With ActiveWorkbook.VBProject.VBComponents(j)
|
||||||
|
If .CodeModule.CountOfLines > 0 Then
|
||||||
|
Select Case .Type
|
||||||
|
Case 100: ext = ".cls"
|
||||||
|
Case 1: ext = ".bas"
|
||||||
|
Case 2: ext = ".cls"
|
||||||
|
Case 3: ext = ".frm"
|
||||||
|
Case Else: ext = vbNullString
|
||||||
|
End Select
|
||||||
|
|
||||||
|
If ext <> vbNullString Then
|
||||||
|
fileName = strSourcePath & "\" & .name & ext
|
||||||
|
If Dir(fileName, vbNormal) <> vbNullString Then Kill (fileName)
|
||||||
|
.Export (fileName)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End With
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
Reference in New Issue
Block a user