VBA Save Workbook is to Save workbook using save method of Workbook object. Where workbook is a part of workbooks collection. We can save file or Workbook using two methods. one is save method another one is saveas method. In the following tutorial we learn about how to save workbook in Excel VBA.
Here is the following syntax to Save Workbook.
Where expression is a required parameter. It represents Workbook object which is part of workbooks collection.
Save represents Workbook method.
Let us see the following example. It saves active Workbook.
'VBA Save Workbook in Excel Sub VBA_Save_Workbook() ActiveWorkbook.Save End Sub
Here are the instructions to use above macro procedure in Visual basic editor.
- Save Visual Basic Editor(VBE) by clicking Alt +F11
- Go to code window by clicking F7
- Copy above specified macro or procedure
- Paste above copied code in code window
- Run macro by clicking F5 or Run command
- You can see output on the screen
- Find above output screenshot of the specified procedure.
You may also like the related Workbook Object articles.