Save-Excel-as
Command Description
Save an Excel as
Command Prototype
Excel.SaveOtherFile(objExcelWorkBook,sFileName)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objExcelWorkBook | True | expression | objExcelWorkBook | Excel workbook object (workbook opened with "Open Excel" command (Excel.OpenExcel) or the workbook object returned by the command "Bind Excel" (Excel.BindBook)) |
sFileName | True | path | '''C:\Users''' | File path used for a "save as" file |
Demo
/************************Save Excel Workbook as ********************* ****************
**Input 1:
** objExcelWorkBook--Excel workbook object (a workbook opened using the "Open Excel" command (Excel.OpenExcel) or a job bound using the "Bind Excel" command (Excel.BindBook) book object).
**Entry 2:
** sFileName--File path to save as file.
**
*********************************************************************/
objExcelWorkBook = Excel.OpenExcel(@res"Test.xlsx",True,"Excel","","")
Excel.SaveOtherFile(objExcelWorkBook,@res"save file.xlsx")
TracePrint "Save Excel workbook: Excel file 'test.xlsx' has been saved as 'save file.xlsx' under the res folder"
Excel.CloseExcel(objExcelWorkBook,False)