ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Overwrite saved workbook in VB Script (https://www.excelbanter.com/excel-programming/395370-overwrite-saved-workbook-vbulletin-script.html)

Martin X.

Overwrite saved workbook in VB Script
 
Hello,

What is the proper method for saving a workbook and overwriting without user
intervention if it already exists? I tried recording a macro and looking at
the VBA code, but it doesn't show the code for overwriting a workbook. I
checked a few online sites but everything I've seen shows how to save a
workbook only, which I already how to do. Thanks.

--
Regards,
Martin X.
MCSA: M



Michael

Overwrite saved workbook in VB Script
 
Use this:

Application.DisplayAlerts = False
Thisworkbook.save
Application.DisplayAlerts = True ' Reseting for other workbooks

Mike Arch.

Please rate this posting if helpful


"Martin X." wrote:

Hello,

What is the proper method for saving a workbook and overwriting without user
intervention if it already exists? I tried recording a macro and looking at
the VBA code, but it doesn't show the code for overwriting a workbook. I
checked a few online sites but everything I've seen shows how to save a
workbook only, which I already how to do. Thanks.

--
Regards,
Martin X.
MCSA: M




Tom Ogilvy

Overwrite saved workbook in VB Script
 
Thisworkbook.Save saves thisworkbook as itself (with its current name and
location) and requires no displayAlert setting.


Perhaps you meant SaveAs (with appropriate arguments).

--
Regards,
Tom Ogilvy


"Michael" wrote:

Use this:

Application.DisplayAlerts = False
Thisworkbook.save
Application.DisplayAlerts = True ' Reseting for other workbooks

Mike Arch.

Please rate this posting if helpful


"Martin X." wrote:

Hello,

What is the proper method for saving a workbook and overwriting without user
intervention if it already exists? I tried recording a macro and looking at
the VBA code, but it doesn't show the code for overwriting a workbook. I
checked a few online sites but everything I've seen shows how to save a
workbook only, which I already how to do. Thanks.

--
Regards,
Martin X.
MCSA: M





All times are GMT +1. The time now is 08:49 PM.

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