Dear Libre Office Users
I am new in Libre Office macros, but I worked a bit with Visual Basic in MS Excel. I would like to write simple function in LO Calc, like this:
Function test()
Dim sum as Double
Dim oSheet
Dim oCell
sum=5
oSheet=ThisComponent.Sheets.getByName("Sheet1")
oCell=oSheet.getCellByPosition(3, 3)
sum=sum+oCell.getValue()
End Function
All seems to be fine (I checked it and there is no errors), but now I would like USE this. So for example I would like to place value of “sum” in some cells like D4. I have no idea how to do this. In Visual Basic it would be
suma=Read(“D4”)
but i have no idea how to do this in LO Calc. I have read “Chapter 12 Macros” in LO guide, but I did not find a solution of this simple problem.