Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
clicking on "My Computer" does not find my Template just created | Excel Discussion (Misc queries) | |||
kill "enable macros" message | Excel Discussion (Misc queries) | |||
"Hyperlinks can be harmfull to your computer and data...." how to shut this off | Excel Discussion (Misc queries) | |||
a button to open up "My Computer" on an excel sheet | Excel Programming |