Functions To Read Excel Worksheets
What's new in Analytica 4.1? >
The functions here can be used to directly read values from existing Excel files. These functions are introduced on an experimental basis in Analytica 4.1.
OpenExcelFile( filename )
Opens an excel workbook file. The filename is interpreted relative to the CurrentDataDirectory.
Returns a workbook object that displays as «ExcelWorkbook».
- Example
- OpenExcelFile( "Sales Figures.xls" ) → «ExcelWorkbook».
WorksheetCell( workbook, sheet, column, row )
Reads the value(s) from an excel worksheet at the given coordinate(s). The first parameter is a workbook object returned by the OpenExcelFile function. Sheet is the name of the worksheet of interest. The row is numeric. The column may be either numeric or by column label. Multiple cells are read when row and column are arrays with one or more common indexes.
- Example
- WorksheetCell( wb, "Sheet1", "C", 7 ) → { The value from cell C7 }
- WorksheetCell( wb, "Sheet1", 3, 7 ) → { The value from cell C7, i.e., row 3, column 7 }
Index I:=['C','D','E']; Index J:=[14,15,16]; WorksheetCell( wb, "Sheet1", I, J ) → { Values from C14:E16 }
WorksheetRange( workbook, sheet, range, colIndex, rowIndex, howToIndex )
Comments
Enable comment auto-refresher