Deleting another workbook through code
Hi I got a userform which askes the user to open up a file. i have store the value as a string. is there a way I can delete that file? I have a workbook which is sent out to many users. I now want t produce an updated version and delete the old workbook. any ideas -- funkymonkU ----------------------------------------------------------------------- funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813 View this thread: http://www.excelforum.com/showthread.php?threadid=51222 |
Deleting another workbook through code
If you save it under a new name and just want to delete the old one, use
Kill oldFilepathandname If you want to delete the activeworkbook On Error GoTo ErrorHandler With ActiveWorkbook If .Path < "" Then .Saved = True .ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName End If End With Exit Sub ErrorHandler: MsgBox "Fail to delete file: " & ActiveWorkbook.FullName Exit Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "funkymonkUK" wrote in message ... Hi I got a userform which askes the user to open up a file. i have stored the value as a string. is there a way I can delete that file? I have a workbook which is sent out to many users. I now want to produce an updated version and delete the old workbook. any ideas? -- funkymonkUK ------------------------------------------------------------------------ funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135 View this thread: http://www.excelforum.com/showthread...hreadid=512228 |
All times are GMT +1. The time now is 09:07 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com