Permission denied code 70 on killfile

C

Curt

Useing the following
Sub KillFile()
Dim myFileName As String
myFileName = "C:\Parade\zzz.txt"
SetAttr myFileName, vbNormal
Kill myFileName ----- this line is yellow in debug
End Sub
Looking thru web could not find answer any help greatly appreciated
Thanks
 
M

Mike H

Curt,

There's nothing wrong with the code. Are you sure that's the correct path?
What error message you getting?

Mike
 
K

Kent Prokopy

Run-time error '70':
Permission Denide

This is caused when the file you are trying to delete is in use by some one
else.
 
C

Curt

Permission Denied error code 70
This same code is working in some other places.
In properties of file (zzz) type of file txt document opens with notepad
Location: C:\Parade
 
C

Curt

New to this there is no one else useing it is not on ?(server or whatever) So
if I follow you correcly it means another macro or part of program is
causeing this. If I am correct how would I find this hang up? Is there a way
when a part of program is run to disconnect use of this file to eliminate
this. Your answer about use is best I've had to understand.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top