View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Remove ThisWorkbook code via VBA

Paul,

Give this a whirl

Function DeleteModule()
Dim vbMod As Object

Set vbMod = ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k")
With vbMod.CodeModule
.DeleteLines 1, .CountOfLines
End With

End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"PCLIVE" wrote in message
...
Using a macro, is it possible to remove the VBA code that exist in
ThisWorkbook?

Thanks,
Paul