Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
All--
I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
Sub KillTvrFiles()
Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the error messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
Sub KillTvrFiles()
Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the warning messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
I got the following error at the part:
With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the error messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
I got the following error at the part:
With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the warning messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
Hi,
Just makse sure you're using the match application version ...! in XL 2003 is supported, but don;t know in the earlier .... Thanks, halim EW menuliskan: I got the following error at the part: With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the error messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
yeah sorry, I'm using XL 2000
" wrote: Hi, Just makse sure you're using the match application version ...! in XL 2003 is supported, but don;t know in the earlier .... Thanks, halim EW menuliskan: I got the following error at the part: With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the error messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
how about just
Kill "C:\program files\ccapps\ttlview\WORK\Reports\*.tvr" -- Regards, Tom Ogilvy "EW" wrote in message ... I got the following error at the part: With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the warning messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Kill file
That worked perfectly! I just need to have our cheap company upgrade its
office products! "Tom Ogilvy" wrote: how about just Kill "C:\program files\ccapps\ttlview\WORK\Reports\*.tvr" -- Regards, Tom Ogilvy "EW" wrote in message ... I got the following error at the part: With Application.FileDialog(msoFileDialogFilePicker) "Object doesn't support this property or method" "Die_Another_Day" wrote: Sub KillTvrFiles() Dim cnt As Long With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = True .InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\" .Filters.Clear .Filters.Add "tvr Files", "*.tvr" .Title = "Please Select Files to be deleted" If .Show = False Then Exit Sub If MsgBox("Are you sure you want to delete all selected files?", _ vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub For cnt = 1 To .SelectedItems.Count Kill .SelectedItems(cnt) Next End With End Sub Charles P.S. Let me know if you want code to kill all .tvr files in that folder and if you need help killng the warning messages. EW wrote: All-- I have a group of files that need to be deleted before running a macro. The files are all named something different but the extentions are all the same (.tvr). Here's the path: C:\program files\ccapps\ttlview\WORK\Reports\ Any help would be great! Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Kill a File | Excel Programming | |||
On time kill | Excel Discussion (Misc queries) | |||
Kill | Excel Programming | |||
'Kill' | Excel Programming | |||
File kill help | Excel Programming |