Quote Originally Posted by makako
[VBA]
Option Explicit

Private Sub Workbook_Open()
Dim ThisModule As Object

On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{0002E157-0000-0000-C000-000000000046}", 5, 3

MsgBox "This project has been registered using code in this module" & vbLf & _
"(Demo: the registration code module will now be deleted)"

Set ThisModule = Application.VBE.ActiveVBProject.VBComponents
ThisModule.Remove VBComponent:=ThisModule.Item ("RunOnceModule")
End Sub
[/VBA]

Is this the poper way?m is not working for me
[vba]Item ("RunOnceModule")[/vba] must contain the name of the module between the quotation marks. Is the module you're trying to delete named 'RunOnceModule'?