I just gave the code not a macro.

Us this and run it from Excel (Tools>Macro>Macros... select KillMyFile from
the list and run it)

Sub KillMyFile()
On Error GoTo ErrorHandler
With ActiveWorkbook
If .Path <> "" Then
.Saved = True
.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
End If
End With
Exit Sub

ErrorHandler:
MsgBox "Fail to delete file: " & ActiveWorkbook.FullName
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"BEEJAY" <BEEJAY@discussions.microsoft.com> wrote in message
news:36614359-A643-40C0-9DFB-CA8E732D46C4@microsoft.com...
> Thanks for the input so far.
> My level of competance is so low that I would not dare to question a
> suggestion
> without trying it out.
> My first problem is that whenever I try to run the code (added in with my
> code),
> the cursor jumps to the very end and comes up with 'Compile Error - Expect
> End Sub'
> If I change the last Exit to End, it still comes up with the same message.
> If someone could point me in the right direction here, then I can do

further
> testing and see what else I have messed up.
> Thank-you
> NOTE: I Rem'd out the one Kill Statement (for now) because it DOES work,
> and I got tired of having to reinstall that file every time I did a test.
>
> "Bob Phillips" wrote:
>
> > Kill is delete.
> >
> > Try it, you'll see.
> >
> > --
> > HTH
> >
> > Bob Phillips
> >
> > (replace somewhere in email address with gmail if mailing direct)
> >
> > "Christmas May" <ChristmasMay@discussions.microsoft.com> wrote in

message
> > news:B4A4FB10-DA0C-4249-B766-A970E722CF1F@microsoft.com...
> > > Bob,
> > >
> > > As a friendly suggestion, the error handler message box mentions

> > "delete"ing
> > > the file. I don't believe the code you posted actually "deletes" the

> > file,
> > > instead, it just unloads it, kills it, etc. If the file were

"deleted" I
> > > would not be able to open/run the file at a later date.

Unloading/Killing
> > > the file simply means I would need to load it from storage(disk) again

at
> > my
> > > convienience.
> > >
> > > Sincerely,
> > >
> > > Christmas May
> > >
> > >
> > >
> > > "Bob Phillips" wrote:
> > >
> > > > On Error GoTo ErrorHandler
> > > > With ActiveWorkbook
> > > > If .Path <> "" Then
> > > > .Saved = True
> > > > .ChangeFileAccess xlReadOnly
> > > > Kill ActiveWorkbook.FullName
> > > > End If
> > > > End With
> > > > Exit Sub
> > > >
> > > >
> > > > ErrorHandler:
> > > > MsgBox "Fail to delete file: " & ActiveWorkbook.FullName
> > > > Exit Sub
> > > >
> > > >
> > > > --
> > > > HTH
> > > >
> > > > Bob Phillips
> > > >
> > > > (replace somewhere in email address with gmail if mailing direct)
> > > >
> > > > "BEEJAY" <BEEJAY@discussions.microsoft.com> wrote in message
> > > > news:B0E65FD6-482B-46A1-87DB-CB98753144AD@microsoft.com...
> > > > > Have a file I call Updater. Sent out with File F2
> > > > > Updater takes info from F1, copies to F2.
> > > > > When process complete, I'd like Updater to be killed,
> > > > > but it is the active workbook.
> > > > > Is there a way to kill a file on closing?
> > > >
> > > >
> > > >

> >
> >
> >