Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ExcelSheet.GetCells faster
Is possible?
Member function ExcelSheet.GetCellsFast
Copy      Help
function ARRAY(str)&a [$range] ;;range examples: "" (all), "sel" (selection), "A1:C3" (range), press F1 to see more.

;Gets whole or part of worksheet into array.

;a - variable for data.
;;;This function creates array of 2 dimensions.
;range - specifies part of worksheet from which to get data. Default: "" - all (used range).
;;;Examples: "sel" (selection in active sheet), "A1:C3" (range), "A:C" (columns A, B and C), "3:3" (row 3), "A1" (cell), "Named" (named range).

;See also: <FE_ExcelRow>.

;Errors: _error

;;display selected cells
;ARRAY(str) a
;ExcelSheet es.Init
;es.GetCellsFast(a "sel")
;int r c
;for r 0 a.len
,;out "-----Row %i-----" r+1
,;for c 0 a.len(1)
,,;out a[c r]

if(!ws) Init

int i j nr nc
Excel.Range r cell

GetRange(range r nr nc)


a.create(av.len av.len(1))
for i 0 a.len
,for j 0 a.len(1)
,,a[j i]=av[i+1 j+1]

err+ E

In next QM will add flag "fast" to GetCells.
Is not easier to replace the function directly?
May not work with some sheets, or get some values different.
Thanks again.
In QM 2.3.3 I want to replace GetCells code with this faster code.
Questions to all using GetCellsFast and SetCellsFast.

1. Are these functions reliable?
2. Did you ever notice some differences between GetCells and GetCellsFast? For example, maybe values of some cells are different.

Now I don't remember why I did not use this faster code in GetCells. Maybe just because did not test speed with large worksheets.
In principle, the two functions work ok.

I use a mixture of both.

One suggestion, if possible, I would create a function (SetCell) for changing ColorIndex, font size and style, border ...

Forum Jump:

Users browsing this thread: 1 Guest(s)