Thread: Kill Function
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
AJM1949 AJM1949 is offline
external usenet poster
 
Posts: 31
Default Kill Function

here is the code used
Sub FPD()
On Error GoTo ErrorHandler

One:
Open "c:\Program Files\Quotemaster\Toyota\FPD.txt" For Input As #1
Input #1, X
Close #1
X = X

Two:
Sheets("Data").Range("FPD").Value = X
Open "c:\Program Files\Quotemaster\Toyota\FPD.txt" For Output As #1
Write #1, X
Close #1

Exit Sub
ErrorHandler:
Select Case Err.Number
Case 53 'If file does not
exist...
X = InputBox("Enter Fleet Pre Delivery Fee", "Create 'Pre
Delivery' File")
Resume Two
Case Else
Resume Next
End Select


End Sub
Sub ChangeFPD()
On Error Resume Next
Kill "C:\Program Files\Quotemaster\Toyota\FPD.txt"
FPD

End Sub

The ChangeFPD macro is run from a custom menu that on some PC's does not
work. The file does exist and is an unprotected text file..The users on the
other pc's assure me they have admoin priviliges
--
AJM1949


"NickHK" wrote:

Kill works on all computers, but without any code of what you doing, it's
impossible to tell.
Does the file exist ?
Does the user have permission ?
Is the file locked ?

NickHK

"AJM1949" wrote in message
...
Can anyone help. Why does the Kill function work on my computers and not

on
some others. Am I missing something?

Regards
--
AJM1949