Overwrite saved workbook in VB Script

  • Thread starter Thread starter Martin X.
  • Start date Start date
M

Martin X.

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.
 
Use this:

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

Mike Arch.

Please rate this posting if helpful
 
Thisworkbook.Save saves thisworkbook as itself (with its current name and
location) and requires no displayAlert setting.


Perhaps you meant SaveAs (with appropriate arguments).
 
Back
Top