Replacement of old modules with updated ones in PERSONAL.XLSB

二次信任 提交于 2020-01-03 03:56:04

问题


I have written a vba code in a workbook (with many modules) and I need to send the archive (such as Setup.XLSB) including the new code to other people at my work.

After they open the Setup.XLSB and click an installer button in order to Call the install_new_modules_inside_personal() , it should replace old modules inside the PERSONAL.XLSB with the new ones.

If the user has already his own modules in PERSONAL.XLSB, I don’t want them to be deleted. I just want my modules including the new code to replace my old ones with the same name.

Private Sub Install_new_modules_inside_personal()

Dim Ver As String
Ver = "3" 'Number of version. Insert manually.

Dim startupFolder As String
startupFolder = Application.StartupPath

'Setup archive check
If ActiveWorkbook.Name <> "Setup.XLSB"  Then
   MsgBox ("Error message.")
   Exit Sub
End If

'Version check. This one here is OK.

'Check if PERSONAL.XLSB else save Setup.XLSB as PERSONAL in Application.StartupPath

'export – import code goes here

End Sub

来源:https://stackoverflow.com/questions/22465984/replacement-of-old-modules-with-updated-ones-in-personal-xlsb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!