Written by Allen Wyatt (last updated May 8, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
If you want to save a workbook under control of your macro, you can use the Save method. This is the same as choosing Save from the ribbon options, so it will display the Save As dialog box if the document you are saving has not been previously saved. The syntax is as follows:
ActiveWorkbook.Save
If you want to save the workbook to a file with a new name, use the following basic syntax:
ActiveWorkbook.SaveAs FileName:="filename"
where "filename" is the full name (including a path), in quotes, that you want used for the file.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10769) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Saving a Workbook in a Macro.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
If you are using Excel as a repository for data used in your business, you may want to figure out a way to make that ...
Discover MoreNot satisfied with the way that default workbooks and worksheets look in Excel? You can easily create your own defaults ...
Discover MoreWhen you starting linking information from one workbook to another, those workbooks become dependent on each other. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments