Excel VBA: Delete Module After Running VBA Code. Deleting Mo

The code below can be used to delete the module which houses the code. In other words, it deletes itself after running once.

You will have to go to Tools>Macro>Security – Trusted Publishers and check Trust access to Visual Basic Editor before running the code. Change “Module1” to suit.

    SubDeleteThisModule()DimvbComAsObjectMsgBox”Hi,Iwilldeletemyself”SetvbCom=Application.VBE.ActiveVBProject.VBComponentsvbCom.RemoveVBComponent:=_vbCom.Item(“Module1”)EndSub

From: http://www.ozgrid.com/VBA/delete-module.htm

可偏偏。多么温柔,一出口便是相互指责和嘲讽。

Excel VBA: Delete Module After Running VBA Code. Deleting Mo

相关文章:

你感兴趣的文章:

标签云: