1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub ExportInportUSF()
' reference : Microsoft Visual Basic for Applications Extensibility 5.3
Dim xlWbk As Workbook
Dim arr As Variant
Dim strFilepath As String
Dim strExt As String, strExt1 As String
Dim i As Long
strFilepath = ThisWorkbook.Path & "\"
strExt = ".frm"
strExt1 = ".frx"
arr = Array("Usf_1", "Usf_2", "Usf_3", "Usf_4")
Set xlWbk = Application.Workbooks.Add
For i = 0 To 3
ThisWorkbook.VBProject.VBComponents(arr(i)).Export strFilepath & i & strExt
With xlWbk
.VBProject.VBComponents.Import strFilepath & i & strExt
End With
Kill strFilepath & i & strExt
Kill strFilepath & i & strExt1
Next i
End Sub |
Partager