Returns a range of values from Excel via ActiveX Automation.
XLGET("rangestr", "bookname", sheet)
"rangestr" |
- |
A string. The Excel cell source range. Defaults to "A1", the first cell. |
"bookname" |
- |
Optional. A string, the Excel Workbook name. Defaults to "" (empty) indicating use current Workbook |
sheet |
- |
Optional. An integer or string, the Excel Sheet number, or sheet name. Defaults to 1, the first sheet if "bookname" is specified, else the current sheet. |
A series, string or scalar if a single value is requested.
W1: rand(10, 3)
xlput("A1:C10", W1)
W2: xlget("A1:C10")
W1 == W2 is all ones, that is W1 and W2 are equivalent. The data is retrieved from the current Sheet of the current Workbook.
W1: rand(10, 3);
xlput("A1:C10", W1, "Book2", 2)
W2: xlget("A1:C10", "Book2", 2);
W1 == W2 is all ones, that is W1 and W2 are equivalent. The data is retrieved from the second Sheet of Workbook Book2.
xlinit("C:\my documents\dsp.xls")
W1: xlget("A1:C10")
W1 contains the data from cells A1 through C10 from the XLS file "C:\my documents\dsp.xls".
If Excel is already running, XLGET attempts to connect to the running instance of Excel, otherwise XLGET connects to a new instance of Excel.
Numeric data is transferred as double precision values.
See XLINIT to open a specific Excel Worksheet file.
See XLPUT to transfer data to Excel.