#1   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default 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
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 a File Posse John Excel Programming 2 August 4th 06 02:23 PM
On time kill Antonio Excel Discussion (Misc queries) 4 June 8th 06 10:50 AM
Kill Michael Excel Programming 2 August 23rd 05 11:53 AM
'Kill' solomon_monkey Excel Programming 7 January 7th 05 09:56 AM
File kill help Marino13[_6_] Excel Programming 0 February 19th 04 01:40 PM


All times are GMT +1. The time now is 06:36 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"