View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Can a macro delete itself (and others)?

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

Here is example

With One macro named "TheMacro" in Module1
The simplest way is to delete the entire module with contains the procedure.

Sub TheMacro()
'
' your code
'
With ThisWorkbook.VBProject.VBCompo*nents
.Remove .Item("Module1")
End With
End Sub

But this must be checked to do this
http://www.j-walk.com/ss/excel/tips/tip96.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"mdb" <m_b_r_a_y@c_t_i_u_s_a__d0t__com wrote in message . ..
From an Excel VBA app (running as an excel macro) is it possible to delete
the macro and all other macros, while the present macro is running? If so,
how?


--
-mdb