I have been maintaining a large macro within my workplace. It is basically a find and replace macro that let's the users easily create client documents. It is housed within the Normal.dot template and contains a "MyName" module and "AcctMgr" module. I have just completed an upgrade and I simply want to replace the "AcctMgr" module with a new one. Replacing the whole Normal.dot file just causes too much pain for the person to have to go into the module and then re-update their name in the "MyName" code.. I can successfully import the module, but it does not overlay the existing "AcctMgr" module as I hoped it would. The new module just gets added as "AcctMgr1". I plan on distributing this through a document where they can just press PF2 to update...
How can I first remove the existing "Acctmgr" .bas module, and then re-add my new one?
Here is what I have so far (and where I am stuck at (????)):
Sub Updateacctmgr()
'Export Module1 from Normal to a BAS file
'VBE.VBProjects("Normal").VBComponents("Acctmgr").
' FileName:="C:\My Documents\acctmgr(03.21.05).bas"
NormalTemplate.VBProject.VBComponents.Remove (????)
'Import the BAS file into Normal.
NormalTemplate.VBProject.VBComponents.Import _
FileName:="G:\CP\AcctMgr\Acctmgr.bas"
NormalTemplate.VBProject.VBComponents.Import _
FileName:="G:\CP\AcctMgr\frmClientInfo.frm"
MsgBox "Your Account Manager Has Been Succesfully Updated", 64, "Account Manager"
MsgBox "Have A Nice Day.", 48, "Account Manager"
End Sub
Any help is greatly appreciated.....
How can I first remove the existing "Acctmgr" .bas module, and then re-add my new one?
Here is what I have so far (and where I am stuck at (????)):
Sub Updateacctmgr()
'Export Module1 from Normal to a BAS file
'VBE.VBProjects("Normal").VBComponents("Acctmgr").
' FileName:="C:\My Documents\acctmgr(03.21.05).bas"
NormalTemplate.VBProject.VBComponents.Remove (????)
'Import the BAS file into Normal.
NormalTemplate.VBProject.VBComponents.Import _
FileName:="G:\CP\AcctMgr\Acctmgr.bas"
NormalTemplate.VBProject.VBComponents.Import _
FileName:="G:\CP\AcctMgr\frmClientInfo.frm"
MsgBox "Your Account Manager Has Been Succesfully Updated", 64, "Account Manager"
MsgBox "Have A Nice Day.", 48, "Account Manager"
End Sub
Any help is greatly appreciated.....