Thread: Kill a File
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Kill a File

You mean you are trying to check the path (and possibly Kill) a file from
within it's own Workbook_Open event ?
You can't Kill an open file, so this will fail. You have seen a Permission
denied error.

Why not check the path before you open it, as you must know the path in
order to open it.
If it is wrong, Kill it.

NickHK

"Posse John" wrote in message
...
I have a file with the Workbook_Open routine looking at the Path for the
current workbook.

If the Path is not equal to the expected location, I want to close the
active file and kill it as part of the subroutine.

Is this possible? I've tried several variations of the KILL command, but

to
no avail.