Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kill Excel Dr. Patrick Havel Excel Programming 1 February 1st 07 01:41 PM
Kill Michael Excel Programming 2 August 23rd 05 11:53 AM
How to Kill a vba macro from a Function// coco Excel Programming 4 June 24th 05 11:11 PM
'Kill' solomon_monkey Excel Programming 7 January 7th 05 09:56 AM
kill worksheets portroe Excel Programming 2 January 25th 04 11:11 PM


All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"