Skip to main content

Bind-Excel

Command Description

Bind an opened Excel and return the bound object

Command Prototype

objExcelWorkBook = Excel.BindBook(sFileName)

Parameter Description

ParameterRequiredTypeDefaultDescription
sFileNameTruestring""Filename of an opened Excel

return

objExcelWorkBook,The variable used to save the output of the command.

Demo

/********************Bind Excel Workbook************************ ****** 
**Incoming parameters:
** sFileName--the file name of the Excel file that has been opened (example: test.xlsx)
**Exports:
** objExcelWorkBook--The variable to which the output of the function call is saved.
**
*********************************************************************/
// This command needs to operate on the Excel file that has been punched in, so first use the Open Excel command to open the file
objExcelWorkBook = Excel.OpenExcel(@res"Test.xlsx",True,"Excel","","")
// --------------------------------------------------------------------
objExcelWorkBook = Excel.BindBook("Test.xlsx")
TracePrint "Bind Excel Workbook: Capture the opened Excel file 'test.xlsx' as an executable object"
Excel.CloseExcel(objExcelWorkBook,False)