Workbook Class (Component)
The Workbook allows you to read and write values to cells from a specified Excel workbook and spreadsheet that may be used in EasyLanguage analysis techniques and strategies. Microsoft Excel is required to successfully run this component.
Typically, you will use the Toolbox to add a component to your EasyLanguage document. Click and drag the name Workbook into your document from the Toolbox. By default, the name of the Workbook appears in the component tray at the bottom of your document followed by a number (to help identify multiple instances of the component).
The file name and full path of the Excel file are entered using the FileName property. The Excel file must exist before the analysis technique or strategy is run.
Individual cells are addressed in the form [column, row]. For example, to import string cell data from the third column, fourth row of the left-most tabbed worksheet into RadarScreen use
plot1(workbook1.sheets[1].CellsAsString[3,4]);
Specific Excel workbook sheets may be addressed using an index number to reference the tabbed sheets from left to right. The far left tab is sheet 1; the next one to the right is 2, etc. For example, a cell in sheet 2 is assigned a string value.
workbook1.sheets[2].CellsAsString[3,3]= "Data11";
Excel workbook sheets may also be addressed using the exact tab name of the spreadsheet.
workbook1.sheets["DatasheetTab1"].CellsAsDouble[1,3]= 456.65;
By default, changes to Excel are not saved. To save changes, set SaveOnClose to true.
Namespace: elsystem.office.excel