I am developing an application in Calc that uses the following code to name a range.
Dim Rname As String
Dim s As String
Dim Doc As Object
Dim Ranges As Object
Dim Sheet As Object
Ranges = Doc.NamedRanges
Sheet = Doc.Sheets.getByName("Sheet1")
Rname = "TestRange"
s = "$Sheet1.$C$11"
Ranges.addNewByName(Rname, s, Sheet.getCellByPosition(2, 10).CellAddress, 0)
The problem is that the code works fine in one computer running Ubuntu 22.10 and LibreOffice 7.4.4.2 but fails in another (the one that is supposed to run the application) with Ubuntu 22.04 LTS and LibreOffice 7.3.7.2.
On the second computer I get a runtime exception “Type: com.sun.star.uno.RuntimeException Message: ./sc/source/ui/unoobj/nameuno.cxx:518.”
This type of failure worries me as it raises questions to the portability of the application to other computers.
Any help will be greatly appreciated. Thank you