My problem is for LibreOffice Calc (and maybe OpenOffice Calc)...
I used the solution from @boiler above, and supplemented it so that both a cell D3, and a range of cells D3:F5, can be specified.
The result is then placed in an object, like this .:
I don't understand what you're saying. He doesn't have Excel. Apparently, the upper-left cell in his spreadsheet is not 1,1 (or R1C1), it's 0,0. And he's not converting from R1C1 since that's Excel specific.
Understands that not everyone can test, but I see no difference on C1 = 6 and D1 := oCellNum[1]
I think it's something else.
This work oCells := oSheet.getCellRangeByPosition(C1, C2, C3, C4)
but this does not oCells := oSheet.getCellRangeByPosition(D1, D2, D3, D4)
I found the problem (but not the solution...)
This work .:D1 := oCellNum[1]
D2 := oCellNum[2]
D3 := oCellNum[3]
D4 := oCellNum[4]
D1 = %D1%
D2 = %D2%
D3 = %D3%
D4 = %D4%
oCells := oSheet.getCellRangeByPosition(D1,D2,D3,D4) ; G10:I11 - 6,9,8,10
The object is text (not numbers) in D1 (before I made it as number D1 = %D1%
Is there any other, better way to handle this on?
The object is text (not numbers) in D1 (before I made it as number D1 = %D1%
Is there any other, better way to handle this on?
I have tried to convert the result in the function() like this.: ...
oCellNum[NumVar] = %ColNum%
NumVar += 1
oCellNum[NumVar] = %RowNum%
...
But when the object is copied to the mainprogram Return % oCellNum the object seams to be text again...
; https://stackoverflow.com/questions/667802/what-is-the-algorithm-to-convert-an-excel-column-letter-into-its-number
ColumnLetterToNumber(l) {
n := 0
loop % StrLen(l) {
n *= 26
n += Asc(SubStr(l, A_Index, 1)) - 64
}
return n
}
; https://learn.microsoft.com/en-us/office/troubleshoot/excel/convert-excel-column-numbers
ColumnNumberToLetter(n) {
l := ""
while n > 0 {
a := Floor((n - 1) / 26)
b := Mod((n - 1), 26)
l := Chr(b + 65) . l
n := a
}
return l
}