Create a new Calc document and run the macro: Sub Test Dim oSheet As Object oSheet=ThisComponent.Sheets(0) With oSheet .getCellRangeByName("A1").setvalue 1 ' A1=1 .getCellRangeByName("A2:A3").merge True ' merge A2:A3 .getCellRangeByName("B3:B4").merge True ' merge B3:B4 ' copy A1:A4 To B1:B4 .copyRange .getCellByPosition(1, 0).cellAddress, .getCellRangeByName("A1:A4").RangeAddress End With End Sub Result: Range not copied. I think in the implementation of the copyRange method it is possible to unmerge the cells in the target range at the beginning of the work. See also: https://forumooo.ru/index.php?topic=11398.msg7102
Repro. Arch Linux 64-bit Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: b710ba48503372ddaf10a17ce7f4f3340bc8adb8 CPU threads: 8; OS: Linux 6.14; UI render: default; VCL: kf6 (cairo+wayland) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: CL threaded Built on 7 May 2025