Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Kill A File

5 views
Skip to first unread message

Aoli

unread,
Feb 7, 2022, 8:30:36 PM2/7/22
to
I try to Kill a file by first trying to set the attributes to normal
then use Kill.
Error message is "File already open"

So what magical API way to delete this file.
Currently on Win 7 Pro if that matters.

Yes I opened it and the app crashed leaving it open.

ObiWan

unread,
Feb 8, 2022, 2:55:53 AM2/8/22
to
:: On Mon, 7 Feb 2022 17:30:30 -0800
:: (microsoft.public.vb.general.discussion)
:: <stsh3o$6ie$1...@gioia.aioe.org>
Expand it please; if you try deleting the file from (say) explorer does
it work (while it doesn't work from your app code) ?



Aoli

unread,
Feb 10, 2022, 12:54:36 PM2/10/22
to

I think the file was locked by my actions in code while in the IDE.
I need to look into this more as it may be something entirely different
that what I now think it is.
Usually if I exit the IDE and restart the IDE, the problem will be gone.
This time the file remains locked even though in the IDE I set
attributes to vbNormal then it still fails to Kill.

ObiWan

unread,
Feb 11, 2022, 4:03:13 AM2/11/22
to
:: On Thu, 10 Feb 2022 09:54:30 -0800
:: (microsoft.public.vb.general.discussion)
:: <su3jgp$19gn$1...@gioia.aioe.org>
:: Aoli <Ao...@Aoli.com> wrote:

> Usually if I exit the IDE and restart the IDE, the problem will be
> gone. This time the file remains locked even though in the IDE I set
> attributes to vbNormal then it still fails to Kill.

This means that something is holding a handle on the file and/or it's
open in exclusive mode (locked) by something; for example if you open
the file inside a separate object or spawned process, if your program
crashes, the separate object/process may still be alive in memory and
holding the file open


0 new messages