makako
03-21-2007, 04:52 PM
Hi, I have a program that i would like to auto-destruct after a specific period of time.
With ThisWorkbook.VBProject.VBComponents("Module1").CodeModule
.DeleteLines 1, .CountOfLines
End With
With ThisWorkbook.VBProject.VBComponents("UserForm").CodeModule
.DeleteLines 1, .CountOfLines
End With
Application.Workbooks("MyMacro").Save
After running it the code is deleted but the workbook does not autosave, thanks
With ThisWorkbook.VBProject.VBComponents("Module1").CodeModule
.DeleteLines 1, .CountOfLines
End With
With ThisWorkbook.VBProject.VBComponents("UserForm").CodeModule
.DeleteLines 1, .CountOfLines
End With
Application.Workbooks("MyMacro").Save
After running it the code is deleted but the workbook does not autosave, thanks