Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Excel + GetCell

I dont know if is possible, but i need to read a row in excell get the data and then i call a function to fill that data on other program.
After that i want to fill on end of that column the data gived by the other program. Till here its ok.

The problem is how i pass to next line and make QM read the next line and fill on end.. and make this till end of rows with dada.

Copy      Help
ExcelSheet es.Init("sheet1" 1|8|16 "D:\userdata\teste\Desktop\teste1.xls")
    goto [PREPARATION]

es.GetCell(cel1 1 2)
es.GetCell(cel2 2 2)
es.GetCell(cel3 3 2)
es.GetCell(cel4 4 2)
es.GetCell(cell5 5 2)

What i need is a way to increment de ROW so the program after fill the cell 6, with the data of other program, he reads the line bellow and so on.
Macro Macro1620
Copy      Help
ExcelSheet es.Init("sheet1" 1|8|16 "D:\userdata\teste\Desktop\teste1.xls")
err goto [PREPARATION]

int r c nr nc ;;row, column, num rows, num cols
nr=es.NumRows(nc) ;;get number of rows and cols
ARRAY(str) a.createlb(nc 1) ;;cells of a row
str s ;;result
for r 1 nr+1 ;;for each row
,for(c 1 nc+1) es.GetCell(a[c] c r) ;;get cells of this row
,YourFunction r a s ;;pass a to your function, and let it store result in s
,es.SetCell(s nc+1 r) ;;set cell at the end of the row

function example
Function YourFunction
Copy      Help
function row ARRAY(str)&a str&s

out "--- row %i ---" row
int c
for c 1 a.ubound+1
,out a[c]

Forum Jump:

Users browsing this thread: 1 Guest(s)