ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting workbook (https://www.excelbanter.com/excel-programming/304072-re-deleting-workbook.html)

Tom Ogilvy

Deleting workbook
 
if dir("R:\PROTEUSIMP.xls") < "" then
kill "R:\PROTEUSIMP.xls"
end if
ActiveWorkbook.SaveAs Filename:="R:\PROTEUSIMP.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

--
Regards,
Tom Ogilvy

"tina" wrote in message
...
Hello
Is it possible to delete a workbook in a macro?
I would like to delete old workbook in first line of code so when the

macro uses the save as command with this name later in code it does not
produce prompt to replace
ActiveWorkbook.SaveAs Filename:="R:\PROTEUSIMP.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",

ReadOnlyRecommended:=False _
, CreateBackup:=False
or is there away to enter true to replace
when I tried with recordmacro nothing was recorded
thanks
Tina





All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com