Hi all
I have a master file that requires an update.
This update is situated in a support pack with multiple modules that need to be imported in the master file
When a user loads this support pack the following should happen:
In the master file the module with the same name has to be deleted then the module of the support pack has to be exported. after this the Master most import the exported module.
So far i only have this piece of code.
Problem is that this code deletes the modules in the support pack and not in the master
Any help is more then welcome
thnx
I have a master file that requires an update.
This update is situated in a support pack with multiple modules that need to be imported in the master file
When a user loads this support pack the following should happen:
In the master file the module with the same name has to be deleted then the module of the support pack has to be exported. after this the Master most import the exported module.
So far i only have this piece of code.
Function DeleteImportExportModules()
MasterWorkbook = ActiveWorkbook.Name 'Master
MasterWorkbookPath = ActiveWorkbook.Path 'Path of the master
SpWorkbook = "Supportpack.xls" ' Support pack
'
'
ModuleRange = Array("Module1", "Module2","Module3")
For i = 0 To 2
Windows(MasterWorkbook).Activate
Set vbCommomMacros = Application.VBE.ActiveVBProject.VBComponents
vbCommomMacros.Remove VBComponent:= _
vbCommomMacros.Item(ModuleRange(i))
Windows(SpWorkbook).Activate
Activeworkbook.VBProject.VBComponents(ModuleRange(i)).Export (MasterWorkbookPath & "\" & ModuleRange(i) & ".bas")
Windows(Masterworkbook).activate
Application.VBE.ActiveVBProject.VBComponents.Import (SFTWorkbookPath & "\" & ModuleRange(i) & ".bas")
Next i
End Function
Problem is that this code deletes the modules in the support pack and not in the master
Any help is more then welcome
thnx