Remove Macro
Hi BNH,
Originally from Chip Pearson:
'==============
Sub SelfDestruct()
Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim HowManyLines As Long
Set VBCodeMod = ThisWorkbook.VBProject.VBComponents("NewModule").C odeModule
With VBCodeMod
StartLine = .ProcStartLine("SelfDestruct", vbext_pk_Proc)
HowManyLines = .ProcCountLines("SelfDestruct", vbext_pk_Proc)
.DeleteLines StartLine, HowManyLines
End With
End Sub
'<<==============
---
Regards,
Norman
"bnhcomputing" wrote in message
...
I have a complex data formatting macro. When the macro is completed, I
need
to remove it before the files goes to the end user. Can a macro remove
itsself?
Open to suggestions (needs to be done programatically)
--
bnhcomputing
|