Deleting file while in use

T

Todd Huttenstine

Hey guys

The Excel file I am trying to delete is the same file that
the code is in.
I know it is impossible to delete or overwrite an Excel
file that is in use by Excel. But is there anyway that
after Excel quits, it can delete itself?


Thanx
Todd Huttenstine
 
T

Tom Ogilvy

Look at the
ChangeFileAccess
method. Have your code change it to readonly , then try to delete it.

I haven't tested it, but it might work.
 
Top