WernerLouw
Board Regular
- Joined
- Dec 9, 2004
- Messages
- 93
Hi,
I had a look at a long discussion on deleting macros from a work book. I now have this problem... The code discussed works fine in the modules but I need to delete the code in one of the worksheets.
Here is the code as discussed:
Public Sub DeleteAllVBA()
For Each book In Workbooks
If book.Name <> ThisWorkbook.Name Then
For Each VBComp In book.VBProject.VBComponents
With VBComp
If .Type = 100 Then
.CodeModule.DeleteLines 1, .CodeModule.CountOfLines
Else
book.VBProject.VBComponents.Remove VBComp
End If
End With
Next VBComp
End If
book.Close SaveChanges:=True
Next book
End Sub
The original code was supplied by Firefytr which then was manipulated by Chitosunday.
This is a bit out of my league but I need to delete te code to protect my work. People are plagerising my work and there is nothing I can do about it, except maybe quit my job...
Can anyone help me please... ray:
I had a look at a long discussion on deleting macros from a work book. I now have this problem... The code discussed works fine in the modules but I need to delete the code in one of the worksheets.
Here is the code as discussed:
Public Sub DeleteAllVBA()
For Each book In Workbooks
If book.Name <> ThisWorkbook.Name Then
For Each VBComp In book.VBProject.VBComponents
With VBComp
If .Type = 100 Then
.CodeModule.DeleteLines 1, .CodeModule.CountOfLines
Else
book.VBProject.VBComponents.Remove VBComp
End If
End With
Next VBComp
End If
book.Close SaveChanges:=True
Next book
End Sub
The original code was supplied by Firefytr which then was manipulated by Chitosunday.
This is a bit out of my league but I need to delete te code to protect my work. People are plagerising my work and there is nothing I can do about it, except maybe quit my job...
Can anyone help me please... ray: