ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting code by macro (https://www.excelbanter.com/excel-programming/302767-re-deleting-code-macro.html)

Rob van Gelder[_4_]

deleting code by macro
 
Sorry - one more thing. This requires a Reference to "Microsoft Visual Basic
for Applications Extensibility"

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Rob van Gelder" wrote in message
news:...
Later versions of Excel have Macro Security which prevent this sort of
activity without having been trusted.

Sub test()
Dim vbc As VBComponent

For Each vbc In ActiveWorkbook.VBProject.VBComponents
vbc.CodeModule.DeleteLines 1, vbc.CodeModule.CountOfLines
Next
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"jriehl" wrote in message
...
Hi there,

is it possible to delete all of a workbooks code automatically by means

of
a
macro?

Lots of thanks

Jürgen








All times are GMT +1. The time now is 10:42 AM.

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