I am trying to write integer numbers from a Python script into Calc cells. The following code snippet works fine with smaller numbers, but with the number shown, the result in the cell is -2041967296.
doc = XSCRIPTCONTEXT.getDocument()
sheet = doc.getCurrentController().getActiveSheet()
cell = sheet.getCellByPosition(0,0)
I appears to me that the python long type is not properly mapped onto the uno type hyper, and hence the binary number is getting truncated.
Following the ideas here in the section on Any, I also tried to replace the cell.setValue line above with
uno.invoke( cell, “setValue” , (uno.Any( “hyper”, 2253000000),) )
However this fails with the error message: cannot coerce argument type during corereflection call!
Can anybody kindly advise how to deal with this, thanks?