Try something like
Sub Auto_Open()
On Error Resume Next
With ThisWorkbook.VBProject.VBComponents
.Remove .Item("modToReplace")
.Import Filename:="C:\Test\modToReplace.bas"
End With
End Sub
See
www.cpearson.com/Excel/VBE.aspx for much more information about working
with the objects in the VBA Editor.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi!
>
> I would like to remove a VB module and import an other one each time I
> open my excel file. Thus I need the code to put in my Sub Auto_Open()
> to remove and import a module.
>
> I just hope these codes exist!
>