Below Code/Example can be used to create a new Excel workbook and save it using VBA Macro.
Syntax and Example of VBA Macro to Create a new workbook:
Syntax and Example of VBA Macro to Create a new workbook:
Sub AddNewWorkbook()
Set WB = Workbooks.Add
WB .Title = "New WB"
WB .SaveAs Filename:="D:\MYNEWFile.xls"
WB .Title = "New WB"
WB .SaveAs Filename:="D:\MYNEWFile.xls"
End Sub
Above code will create a new workbook with title as New WB and It will Save the new Workbook to location D:\MYNEWFile.xls
No comments:
Post a Comment