Functions To Read Excel Worksheets

Revision as of 23:02, 22 January 2008 by Lchrisman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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


You are not allowed to post comments.