Kill a file

G

Gautam

I tried to use the following code for killing file which already
exists. The process is stuck at the second file that is available in
the dir, but the program is not able to find that file, The control
moves from Kill "C:\Temp\asptbkt.jrst" to Error and resumes with
err.number 55.. This is creating a lot of chaos in my program.


On Error GoTo errorhandler
Kill "C:\Temp\asptnozzle.jrst"
Kill "C:\Temp\asptbkt.jrst"
Kill "C:\Temp\asptclearance.jrst"
Kill "C:\Temp\asptbalancehole.jrst"

' CLEAR THE SCREEN
Screen_Mopping ' calling Screen Clear subroutine

THRUST_Click ("asptnozzle.edi") ' calling ASPL subroutine for Nozzle
Data

THRUST_Click ("asptbkt.edi")
THRUST_Click ("asptclearance.edi")
THRUST_Click ("asptbalancehole.edi")

errorhandler:
Select Case Err.Number
Case 53
Resume Next
Case 55 ' "File already open" error.
Close #1 ' Close open file.
Resume
End Select


Can anyone solve this puzzle
 
D

Dave Peterson

I think I'd try to find out why that file is open.

Did you open it in any of your code? Do you have another application/process
running that's using it?

Maybe that other program hasn't finished with it????
 
G

Gautam

I think I'd try to find out why that file is open.

Did you open it in any of your code? Do you have another application/process
running that's using it?

Maybe that other program hasn't finished with it????












--

Dave Peterson- Hide quoted text -

- Show quoted text -

i tried to find if the file is open, and what i did was to close all
the files that were open by using "close". This worked.

Thanks for your attention
 

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