ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I force the file to over write the existing file (https://www.excelbanter.com/excel-programming/371048-how-can-i-force-file-over-write-existing-file.html)

Ed

How can I force the file to over write the existing file
 
have the follow code which works fine unless a file of that name already
exists.
wbkNew.SaveAs sFileName

How can I force the file to over write the existing file.

Ed


Jeff M

How can I force the file to over write the existing file
 
Try:

On Error Resume Next
kill sFileName
On Error GoTo 0
sbkNew.SaveAs sFileName

Cheers - Jeff

"Ed" wrote:

have the follow code which works fine unless a file of that name already
exists.
wbkNew.SaveAs sFileName

How can I force the file to over write the existing file.

Ed



All times are GMT +1. The time now is 03:07 PM.

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