Description:
Enter cell values to an Excel file object or read values from it.
Syntax:
xo.xlscell(a:b,s ;t)
Note:
The function enters values to Excel sheet s or read values from it. Parameter xo is an Excel file object read in the non-@r@w way.
When parameter t is present, enter string t separated by the carrige return “\r”(which means the content will be entered into the next row) or tab“\t” (which means the content will be entered into the next column), starting from cell a, and save the entered data using the xlswrite() funtion. t can be a string, a sequence of sequences, or a single value.
If t is absent, read values from cell a to cell b and return them as a string; if parameter b is absent, read the value of cell a only when the counterpart parameter is a; and read values through to the last cell having a value when the counterpart parameter is a:.
Parameter:
xo |
An Excel file object read in a non-@r@w way |
a |
Cell a |
b |
Cell b |
s |
Sheet number, which should not exceed 31 characters and contain special characters []:/\?*, or sheet name; it is the first page when omitted |
t |
The to-be-populated data; can be omitted |
Option:
@i |
Insert a row after the row containing cell a and enter the specified data; by default there won’t be insertion and the existing data will be overwritten |
@w |
Enable returning a sequence of sequences of cell values at read-in |
@g |
Parameter :b will be absent and parameter t is blob type when using this option to read in or configure an image; support jpg an pnag only |
@p |
Work with @w to return a sequence of sequences; each sub-sequence is made up of column values |
@n |
Remove blanck spaces on both sides of a string; read an empty string as null |
Return value:
No return value or a string
Example:
|
A |
|
1 |
=file("E2.xlsx").xlsopen() |
Read the Excel file object |
2 |
=A1.xlscell("A1":"C4",1) |
Read data from cell A1 to cell C4 on sheet 1 in E2.xlsx, and return it as a string |
3 |
=A1.xlscell("B2","s2") |
Read data from cell B2 to the end on sheet s2 in E2.xlsx, and return it as a string |
4 |
=A1.xlscell("A3","s2";"aa\rbb\tcc") |
Enter string aa into cell A3 on sheet s2, enter string bb into cell A4 in the next row, and enter string cc into cell B3 in the next column |
5 |
=A1.xlscell@i("A3",;"smile") |
smile Insert a row after the one containing cell A4 on sheet 1, which becomes the 4th row, and then enter string smile in it |
6 |
=file("emp.xls").xlsopen().xlscell@w("A1":"C3") |
|
7 |
D:/picture.xls |
picture.xls is as below: |
8 |
=file(A7).xlsopen().xlscell@g("B2") |
|
9 |
=file("tp.xls").xlsopen() |
Open tp.xls file and return the Excel object |
10 |
=A9.xlscell@g("G8",;A8) |
Write the blob type data in A8 to G8 in tp.xls |
11 |
=file("tp.xls").xlswrite(A9) |
Save the Excel object to tp.xls |
12 |
=A9.xlscell(,"Sheet2";"cmm2") |
Rename Sheet2 in tp.xls cmm2 |
13 |
=now() |
Return the current time |
14 |
=file("wtest.xls").xlsopen().xlscell@w("A1";A13) |
Write the value returned by A13 to A1 in wtest.xls |
15 |
=file("emp.xls").xlsopen().xlscell@wp("A1":"C3") |
options to return a sequence of sequences whose members are column values |