In Order for this to work, you will need to change the Trust Center Settings:
Import a list of modules (Use VBA instead of Manually doing it)
In the example, Modules/Forms are located in 2 different folders - used 2 strings for Path / File Names
Sub a_99_IMPORT_Modules_Forms_UniversalTranslator()
Dim aSplitMe As Variant
Dim wbTarget As Workbook
Dim sModListDynamic As String, sModListBasic As String
'Set the path for the 2 sets of Modules:
Const sFilePathDynamic As String = "E:\Backup\UniversalTranslator\Excel-VBA Tools\Dynamic_Supplier-KravetTool-Replacement\"
Const sFilePathBasic As String = "E:\Backup\UniversalTranslator\Excel-VBA Tools\"
'Set the strings that contain the list of modules/forms to be imported
sModListDynamic = "mod_Stage1_MatchKey_SF.bas^mod_Stage1_MatchKey_USMD.bas^mod_Stage2_MatchKey.bas^mod_Stage3_PrepInstructionSheet.bas^mod_Stage3_PrepReviewSheet.bas^mod_Stage4_PrepStoreMgr.bas^mod_Stage5_Discontinued_Part2.bas^mod00_HeaderMap_H.bas^mod99_ImageCode.bas^mod99_PricingFormulas.bas^modSplitTabsUsingFilterMarker.bas^form_CreatePricing.frm^frmProcessImages.frm"
sModListBasic = "mod99_PublicFunctions.bas^modCaps.bas^modMatchDISC.bas^modStandardizeWidth.bas^Z_modAttributeStrings.bas^Z_modAttributeTemplateAAA.bas"
'Set the workbook that the modules/forms will be imported into:
Set wbTarget = ActiveWorkbook
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Dynamic Modules/Forms)
aSplitMe = Split(sModListDynamic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Import sFilePathDynamic & aSplitMe(iLoop)
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Basic Modules/Forms)
aSplitMe = Split(sModListBasic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Import sFilePathBasic & aSplitMe(iLoop)
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
Erase aSplitMe
End Sub
Dim aSplitMe As Variant
Dim wbTarget As Workbook
Dim sModListDynamic As String, sModListBasic As String
'Set the path for the 2 sets of Modules:
Const sFilePathDynamic As String = "E:\Backup\UniversalTranslator\Excel-VBA Tools\Dynamic_Supplier-KravetTool-Replacement\"
Const sFilePathBasic As String = "E:\Backup\UniversalTranslator\Excel-VBA Tools\"
'Set the strings that contain the list of modules/forms to be imported
sModListDynamic = "mod_Stage1_MatchKey_SF.bas^mod_Stage1_MatchKey_USMD.bas^mod_Stage2_MatchKey.bas^mod_Stage3_PrepInstructionSheet.bas^mod_Stage3_PrepReviewSheet.bas^mod_Stage4_PrepStoreMgr.bas^mod_Stage5_Discontinued_Part2.bas^mod00_HeaderMap_H.bas^mod99_ImageCode.bas^mod99_PricingFormulas.bas^modSplitTabsUsingFilterMarker.bas^form_CreatePricing.frm^frmProcessImages.frm"
sModListBasic = "mod99_PublicFunctions.bas^modCaps.bas^modMatchDISC.bas^modStandardizeWidth.bas^Z_modAttributeStrings.bas^Z_modAttributeTemplateAAA.bas"
'Set the workbook that the modules/forms will be imported into:
Set wbTarget = ActiveWorkbook
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Dynamic Modules/Forms)
aSplitMe = Split(sModListDynamic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Import sFilePathDynamic & aSplitMe(iLoop)
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Basic Modules/Forms)
aSplitMe = Split(sModListBasic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Import sFilePathBasic & aSplitMe(iLoop)
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
Erase aSplitMe
End Sub
Zipping tool that can be used to concatenate the strings:
Sub a_99a_ZipList_Modules_Forms()
Dim iLoop As Long, sTemp As String
Dim iEnd As Long
Dim iCol As Long
iEnd = 13
iCol = 2
For iLoop = 1 To iEnd
sTemp = sTemp & "^" & Cells(iLoop, iCol)
Next iLoop
Debug.Print sTemp
End Sub
Dim iLoop As Long, sTemp As String
Dim iEnd As Long
Dim iCol As Long
iEnd = 13
iCol = 2
For iLoop = 1 To iEnd
sTemp = sTemp & "^" & Cells(iLoop, iCol)
Next iLoop
Debug.Print sTemp
End Sub
During Testing, it can be tedious to remove modules - this makes it easier
Sub a_99b_REMOVE_Modules_Forms_UniversalTranslator()
'This allows a reset to remove modules/forms created during testing phase:
Dim wbTarget As Workbook
'Set the strings that contain the list of modules/forms to be imported
sModListDynamic = "mod_Stage1_MatchKey_SF^mod_Stage1_MatchKey_USMD^mod_Stage2_MatchKey^mod_Stage3_PrepInstructionSheet^mod_Stage3_PrepReviewSheet^mod_Stage4_PrepStoreMgr^mod_Stage5_Discontinued_Part2^mod00_HeaderMap_H^mod99_ImageCode^mod99_PricingFormulas^modSplitTabsUsingFilterMarker^form_CreatePricing^frmProcessImages"
sModListBasic = "mod99_PublicFunctions^modCaps^modMatchDISC^modStandardizeWidth^Z_modAttributeStrings^Z_modAttributeTemplateAAA"
'Set the workbook that the modules/forms will be imported into:
Set wbTarget = ActiveWorkbook
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Dynamic Modules/Forms)
aSplitMe = Split(sModListDynamic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Remove wbTarget.VBProject.VBComponents(aSplitMe(iLoop))
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Basic Modules/Forms)
aSplitMe = Split(sModListBasic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Remove wbTarget.VBProject.VBComponents(aSplitMe(iLoop))
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
End Sub
'This allows a reset to remove modules/forms created during testing phase:
Dim wbTarget As Workbook
'Set the strings that contain the list of modules/forms to be imported
sModListDynamic = "mod_Stage1_MatchKey_SF^mod_Stage1_MatchKey_USMD^mod_Stage2_MatchKey^mod_Stage3_PrepInstructionSheet^mod_Stage3_PrepReviewSheet^mod_Stage4_PrepStoreMgr^mod_Stage5_Discontinued_Part2^mod00_HeaderMap_H^mod99_ImageCode^mod99_PricingFormulas^modSplitTabsUsingFilterMarker^form_CreatePricing^frmProcessImages"
sModListBasic = "mod99_PublicFunctions^modCaps^modMatchDISC^modStandardizeWidth^Z_modAttributeStrings^Z_modAttributeTemplateAAA"
'Set the workbook that the modules/forms will be imported into:
Set wbTarget = ActiveWorkbook
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Dynamic Modules/Forms)
aSplitMe = Split(sModListDynamic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Remove wbTarget.VBProject.VBComponents(aSplitMe(iLoop))
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
'Split String (Import the Basic Modules/Forms)
aSplitMe = Split(sModListBasic, "^")
'Load All non blank values into the Array (Header Position)
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
wbTarget.VBProject.VBComponents.Remove wbTarget.VBProject.VBComponents(aSplitMe(iLoop))
Next iLoop
'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
End Sub