I got the example code from here, but this code:
Sub WrapTextInACell
ThisComponent.CurrentController.ActiveSheet.getCellByPosition(7, 3).String = "TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest"
ThisComponent.CurrentController.ActiveSheet.getCellRangeByPosition(7, 3).IsTextWrapped = False
ThisComponent.CurrentController.ActiveSheet.getCellRangeByPosition(7, 3).IsTextWrapped = True
End Sub
gave this error message:
What is the problem?
0046WrapTextInACellOrMergedCell.ods (13.0 KB)
LibreOffice:
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.1
Calc: threaded
OS:
Ubuntu 22.04 LTS Desktop