Chris here's a link to where i posed the question
http://www.excelforum.com/showthread.php?t=553507 or you could try
coding in your Auto_open the exact file path i.e if thisworkbook.path
< "and then put in your filepath to an obscure named folder perhaps"
then KillActive
Try this below, its not fool proof but you can set the file path and if
the workbook is opened not in the specified path it will delete itself!
However, deleting something on another persons computer is classed as
"virus activity" and should not be carried out without you stating your
intentions!
Sub Auto_Open()
If Thisworkbook.Path < "YOUR PATH HERE" Then
Call KillActive
End If
End Sub
Sub KillActive()
dim sName as String
On Error Resume Next
sName = ThisWorkbook.FullName
Application.DisplayAlerts = False
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill sName
Application.DislayAlerts = True
ThisWorkbook.Close SaveChanges:=False
End Sub
--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.excelforum.com/member.php...fo&userid=6708
View this thread:
http://www.excelforum.com/showthread...hreadid=571307