Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, 1. Please let me know how to kill the opened file permanently by a macro. and I have an other folder name TempReports on C:\shahzad\reports \TempReports 2. I want to delete all files of the TempReports folder at once by running a single macro. please send me reply, thanks in advance. Regards. Shahzad |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Shazi
1: Change ChangeFileAccess ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False 2: http://www.rondebruin.nl/folder.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Shazi" wrote in message ... Hi, 1. Please let me know how to kill the opened file permanently by a macro. and I have an other folder name TempReports on C:\shahzad\reports \TempReports 2. I want to delete all files of the TempReports folder at once by running a single macro. please send me reply, thanks in advance. Regards. Shahzad |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try 1) With Workbooks("Book4.xls") .ChangeFileAccess xlReadOnly Kill .FullName End With 2) Dim FF As Object Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set FF = FSO.getfolder("C:\Test") FF.Delete This will destroy the folder C:\Test and all its contents. If you want to folder C:\Test to remain, use MkDir to create it after deletion. Dim FF As Object Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set FF = FSO.getfolder("C:\Test") FF.Delete MkDir "C:\Test" Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Tue, 27 Jan 2009 14:29:43 -0800 (PST), Shazi wrote: Hi, 1. Please let me know how to kill the opened file permanently by a macro. and I have an other folder name TempReports on C:\shahzad\reports \TempReports 2. I want to delete all files of the TempReports folder at once by running a single macro. please send me reply, thanks in advance. Regards. Shahzad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Kill file | Excel Programming | |||
Kill file | Excel Programming | |||
Kill a File | Excel Programming | |||
code to check file size everytime an Excel file is opened | Excel Programming | |||
stop excel file opened as read only if already opened by another u | Excel Programming |