ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove Macro (https://www.excelbanter.com/excel-programming/341290-remove-macro.html)

bnhcomputing[_2_]

Remove Macro
 
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

Norman Jones

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




Jim Thomlinson[_4_]

Remove Macro
 
Check out this link...

http://www.cpearson.com/excel/vbe.htm
--
HTH...

Jim Thomlinson


"bnhcomputing" wrote:

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


Gord Dibben

Remove Macro
 
All you should need to know can be found at Chip Pearson's site.

http://www.cpearson.com/excel/vbe.htm


Gord Dibben Excel MVP

On Tue, 27 Sep 2005 14:55:01 -0700, bnhcomputing
wrote:

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)



Jim Thomlinson[_4_]

Remove Macro
 
It seems the only one who did not reply to this thread was Chip...
--
HTH...

Jim Thomlinson


"Gord Dibben" wrote:

All you should need to know can be found at Chip Pearson's site.

http://www.cpearson.com/excel/vbe.htm


Gord Dibben Excel MVP

On Tue, 27 Sep 2005 14:55:01 -0700, bnhcomputing
wrote:

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)





All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com