Skip to content

excelSetWorkbookContext (Excel Verification, Manipulation & Persistence)

Compatible with:
  • Purpose
  • This command can be used to create a new workbook context in memory with a name specified in the 'Value' field.
  • The default excel file format is xlsx. If the provided file format is other than xlsx, then the parameter 'excelFormat' has to be passed mandatorily.
  • Syntax
  • excelSetWorkbookContext(nameOfExcelFile||excelFormat, variableHoldingWorkbookHandle)
  • Target
  • nameOfExcelFile||excelFormat
    • The 'nameOfExcelFile' provided must match with the filename (including file extension) of a file that exists within the 'Files' module within the Project in the context of which the automated test that containing this command executes.
    • Instead of providing the name of a file that exists within your Project, if you choose, you can also provide a local variable name or a user-defined variable name into the 'nameOfExcelFile' parameter of the target if those variables hold a pointer to the name of an Excel file that exists within your Project.
    • The 'excelFormat' has to be one of the following formats supported within Worksoft SaaS: xlsx, xls, xlsm
  • Value
  • variableHoldingWorkbookHandle
    • This value can then be input into the 'target' field of other commands like 'excelSetWorksheetContextWithinWorkbook', etc.,
  • Return Value
  • N/A
  • Errors & Exceptions  
  • Condition Error/Exception Message
    Non-existing File The file name provided in the target field does not exist within the 'Files' module within the project.
    Unsupported File Format The file format that is provided in the target field is not a supported format for this command.

 


Feedback and Knowledge Base