Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default A computer with morals?...it doesn't want to "kill"

The below code works fine on the 5 computers I've installed it on.
However, one computer is not liking the "kill" command, I've stepped
through and it kicks out of the sub once it hits the "Kill cell" line.
Any idea why?

Dim rng As Range, cell As Range
Set rng = Range(Cells(1, 3), Cells(1, 3).End(xlDown))
For Each cell In rng
If Dir(cell) < "" Then
Kill cell
End If
Next

TIA,
Mike

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default A computer with morals?...it doesn't want to "kill"

Kill usually wants a string rather than a range. Maybe
dim s as string
s=cell.value (in the loop)
and then
kill s
--
Gary''s Student


"Michael Smith" wrote:

The below code works fine on the 5 computers I've installed it on.
However, one computer is not liking the "kill" command, I've stepped
through and it kicks out of the sub once it hits the "Kill cell" line.
Any idea why?

Dim rng As Range, cell As Range
Set rng = Range(Cells(1, 3), Cells(1, 3).End(xlDown))
For Each cell In rng
If Dir(cell) < "" Then
Kill cell
End If
Next

TIA,
Mike

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A computer with morals?...it doesn't want to "kill"

Possibly the user doesn't have file permissions that would allow the file to
be deleted. Check with your network administrator. This isn't something
related to excel or VBA if it is the source of the problem.

--
Regards,
Tom Ogilvy


"Michael Smith" wrote in message
...
The below code works fine on the 5 computers I've installed it on.
However, one computer is not liking the "kill" command, I've stepped
through and it kicks out of the sub once it hits the "Kill cell" line.
Any idea why?

Dim rng As Range, cell As Range
Set rng = Range(Cells(1, 3), Cells(1, 3).End(xlDown))
For Each cell In rng
If Dir(cell) < "" Then
Kill cell
End If
Next

TIA,
Mike

*** Sent via Developersdex http://www.developersdex.com ***



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A computer with morals?...it doesn't want to "kill"

Another thought - is it a read only file? Check using Windows Explorer.
Right click on the file and select view properties.

--
Regards,
Tom Ogilvy

"Michael Smith" wrote in message
...
The below code works fine on the 5 computers I've installed it on.
However, one computer is not liking the "kill" command, I've stepped
through and it kicks out of the sub once it hits the "Kill cell" line.
Any idea why?

Dim rng As Range, cell As Range
Set rng = Range(Cells(1, 3), Cells(1, 3).End(xlDown))
For Each cell In rng
If Dir(cell) < "" Then
Kill cell
End If
Next

TIA,
Mike

*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default A computer with morals?...it doesn't want to "kill"


Thanks for the advice all, but I've checked in to all your suggestions,
and none fix it. User's permissions on not restricted, files are not
read only, and tried kill as a string. It still hits the kill line, and
exits the macro. Any other thoughts?
Thanks so much for the posts!
-Mike

*** Sent via Developersdex http://www.developersdex.com ***
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
clicking on "My Computer" does not find my Template just created Luis Excel Discussion (Misc queries) 0 June 9th 06 11:57 AM
kill "enable macros" message bcamp1973 Excel Discussion (Misc queries) 5 March 15th 06 11:49 PM
"Hyperlinks can be harmfull to your computer and data...." how to shut this off marko Excel Discussion (Misc queries) 0 February 17th 06 12:27 PM
a button to open up "My Computer" on an excel sheet DorisM Excel Programming 5 August 16th 05 08:32 PM


All times are GMT +1. The time now is 04:29 AM.

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"