Method: SaveAs for Workbook
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: SaveAs for Workbook
Method: SaveAs for Workbook
Saves an Excel workbook.
bSaveAs = Object.SaveAs(Filename)
Object | Workbook Object with this method |
Filename | String Specifies the path and the name of the Excel file. You must enter the filename extension. |
bSaveAs | Boolean Specifies whether saving was successful (TRUE) or not (FALSE). |
The following example creates an Excel workbook, fills the first cell in the first worksheet with the value 3.14, and saves the Excel workbook in a new XLSX file. Refer to the help page Workbook for detailed examples:
VBScript | Python |
Dim oMyWorkbook, oMySheet Set oMyWorkbook = CreateExcelWorkbook() Set oMySheet = oMyWorkbook.Worksheets(1) oMySheet.Cells(1, 1).Value = 3.14 Call oMyWorkbook.SaveAs(DataWritePath & "Test.xlsx")