

Wkb.SaveAs Filename:="C:\WorkbookName1. You can set the newly created workbook to an object, so that it is easy to refer to your workbook to do further tasks. Save the file as macro enabled workbookĬreate an object for newly created workbook.You should see newly opened workbook as shown above.Copy the above code and Paste in the code window.You should see newly opened workbook along with existing workbook. Go to any of the worksheet tabs, right-click, and select ‘View Code’. Using the Worksheet Tab This is a less used method to open the Vb Editor. In the Code group, click on Visual Basic. ActiveWorkbook.SaveAs method will save the active workbook to a specific location with specified File name To open the Visual Basic Editor from the ribbon: Click the Developer tab (if you don’t see a developer tab, read this on how to get it).Workbooks.Add method will add a new workbook.Code:ĪctiveWorkbook.SaveAs "C:\WorkbookName.xls"ĪctiveWorkbook.SaveAs Filename:="C:\WorkbookName1.xls"

You can use the following code to create new Workbook and save in the C drive using Add method. Create an Object for newly created workbook.Create New Workbook in Excel VBA – Example Cases: The following Macros will allow to open or create new workbook using Add method. Sometimes we may want to open or create new workbook using VBA.You can set the newly created workbook to an object, so that it is easy to refer to your workbook to do further tasks.
