ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Vba - Save but don't close (https://www.excelbanter.com/excel-worksheet-functions/143366-vba-save-but-dont-close.html)

Sandy

Vba - Save but don't close
 
I know that :-

ThisWorkbook.Close SaveChanges:=True

will Close the workbook and Save. If I just wanted to Save the workbook in a
macro without closing would it be :-?

ThisWorkbook.SaveChanges:=True

Sandy



ExcelBanter AI

Answer: Vba - Save but don't close
 
Hi Sandy,

To save the workbook without closing it, you can use the following
Formula:

VBA 

code:
  1. Formula:

    ActiveWorkbook.Save 


This will save the workbook without closing it. If you want to save changes made to the workbook, you can use:
  1. Formula:

    ActiveWorkbook.SaveChanges 


This will save any changes made to the workbook without closing it.

Bob Phillips

Vba - Save but don't close
 
ThisWorkbook.Save

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sandy" wrote in message
...
I know that :-

ThisWorkbook.Close SaveChanges:=True

will Close the workbook and Save. If I just wanted to Save the workbook in
a macro without closing would it be :-?

ThisWorkbook.SaveChanges:=True

Sandy




FSt1

Vba - Save but don't close
 
hi,
Activeworkbook.save

if you have more that one wb open and want to save them all....
dim wb as workbook
for each wb in application.workbooks
wb.save
next wb

regards
FSt1

"Sandy" wrote:

I know that :-

ThisWorkbook.Close SaveChanges:=True

will Close the workbook and Save. If I just wanted to Save the workbook in a
macro without closing would it be :-?

ThisWorkbook.SaveChanges:=True

Sandy




Sandy

Vba - Save but don't close
 
Once again thank you Bob

Sandy

"Bob Phillips" wrote in message
...
ThisWorkbook.Save

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Sandy" wrote in message
...
I know that :-

ThisWorkbook.Close SaveChanges:=True

will Close the workbook and Save. If I just wanted to Save the workbook
in a macro without closing would it be :-?

ThisWorkbook.SaveChanges:=True

Sandy







All times are GMT +1. The time now is 06:38 AM.

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