View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
moon[_6_] moon[_6_] is offline
external usenet poster
 
Posts: 43
Default Kill Files in Excel 2000


Tested this one under Excel 2000 and it seems to work okay.
Did you perform a step-through already?




"AJM1949" schreef in bericht
...
I have the following code which works fine in Excel 2002 and later, but
wont
run in excel 2000.
Sub GovtPD()

On Error GoTo ErrorHandler

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

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

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

End Sub
Sub ChangeGovtPD()
On Error Resume Next
Kill "c:\Program Files\Mazda Quotemaster\GovtPD.txt"
GovtPD
End Sub

Any suggestions as to why it does not work in Excel 2000 and how to fix it
would be greatly appreciated.

AJM1949