Article ID: 172109
Article Last Modified on 11/23/2006
Sub DeleteAfterRun()
Dim x As Object
' This is the code that I want to run once.
MsgBox "Hello, World!"
Set x = Application.VBE.ActiveVBProject.VBComponents
' Delete the current module.
x.Remove VBComponent:=x.Item("TestModule")
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: XL97 8.0
Keywords: kbcode kbhowto KB172109