Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill Function
Can anyone help. Why does the Kill function work on my computers and not on
some others. Am I missing something? Regards -- AJM1949 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill Function
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill Function
Remove the On Error Resume Next from your ChangeFPD routine to see what the
error actually is, or include proper error handling. Also, you may want to look at FreeFile. And, what is the purpose of: X = X NickHK "AJM1949" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Kill Excel | Excel Programming | |||
Kill | Excel Programming | |||
How to Kill a vba macro from a Function// | Excel Programming | |||
'Kill' | Excel Programming | |||
kill worksheets | Excel Programming |