Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | excelGetCell(workbookFID, [worksheet_name], cell_addr_or_x_y) | Package | excel | Alias | | Pkg Usage | getCell(workbookFID, [worksheet_name], cell_addr_or_x_y) | |
Description
Excerpt |
---|
|
Gets the string value from the specified cell. |
Gets the string value from the specified cell.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
workbookFID | Integer | Yes | The file id of the open workbook. The file id is returned from running the excelOpenWorkbook() routine. | worksheet_name | String | No | The name of the worksheet the cell is on. | cell_addr_or_x_y | String | No | The cell address, like A1, or the cell coordinates like 2, 3. | |
Return Type
String
Example
Get the values from cells in a workbook.
Code Block |
---|
|
use "excel";
int fid = openWorkbook("snakes.xlsx");
string name = getCell(fid, "Venemous Snakes", "A2");
string species = getCell(fid, "Venemous Snakes", 1, 1);
runnerLog(name + " - " + species);
closeWorkbook(fid); |
Result: Mainland Tigersnake - Notechis Scutatus. Note that the row index used to get the species name is 1 even though the cell address would be B2. This is because the cell index starts at 0.
Note |
---|
Click here to download the workbook used in this example. |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "excel_routine" and space = currentSpace ( ) |
---|
labels | array_routines |
---|
|