Hi Phil, l can give you some bits of code you may be able to use:
This will delete the VBA in a workbook....
Option Explicit
Public Sub BinallVBAinwb()
Dim vbComp As Object
For Each vbComp In ActiveWorkbook.VBProject.VBComponents
With vbComp
If .Type = 100 Then
.CodeModule.DeleteLines 1, .CodeModule.CountOfLines
Else
ActiveWorkbook.VBProject.VBComponents.Remove vbComp
End If
End With
Next vbComp
End Sub
This is a workbook 'expiry' piece of code...
Open this with macro's diabled.. otherwise you will not be able to change
the date...
Option Explicit
Private Sub Workbook_Open()
'Public should be private when doing this for real
Dim myCutOff As Long
myCutOff = DateSerial(2002, 10, 6)
If Date > myCutOff Then
MsgBox "I'm sorry, this workbook should have expired on: " _
& Format(myCutOff, "mm/dd/yyyy") & vbLf & _
"After you dismiss this box, this program will pause for: " _
& CLng(Date) - myCutOff & " seconds!" & vbLf & vbLf & _
"One second for each day past expiration!"
Application.Wait TimeSerial(Hour(Now), Minute(Now), _
Second(Now) + CLng(Date) - myCutOff)
End If
End Sub
This macro will delete itself....(just module one.. once it has ran!)
Sub deletmodule1()
MsgBox "place your code here"
With ThisWorkbook.VBProject.VBComponents
.Remove .Item("Module1")
End With
End Sub
hope these help..
seeya ste