Disable dialog in macro using merge cells

I had a macro that was working for a long time, but with a recent update of libreOffice, I had to reset my user profile as merging of cells with content did no longer work.
Now merging agian works my macro is always showing the merge-cells dialog, when before I could suppress it with following code:

dim argsMerge(0) as new com.sun.star.beans.PropertyValue
argsMerge(0).Name = “MoveContents”
argsMerge(0).Value = true
rem argsMerge(1).Name = “ShowDialog”
rem argsMerge(1).Value = false

dispatcher.executeDispatch(document, “.uno:MergeCells”, “”, 0, argsMerge())

This is the snippet of my code excuting the merge, the selection of cells to be merged is done upfront and works fine.

Anyone have any ideas why this stopped working or any suggestions to prevent the dialog to popup ?

There was never a “ShowDialog” argument for .uno:MergeCells UNO command. So that looks like some cargo cult here.

However, there is ShowDialog compatibility option in OptionsAdvancedExpert Configuration, for the MergeCells dialog (it was introduced in 2017). Maybe it was set to false for you before. It may also be set programmatically, for the duration of some call, if needed.

1 Like

I think that (your explanation, and the OP’s question and code snippet) is helping. I’m still in “larval stage” with LOo macros - well, OOP in general - but I’d sort-of come to the idea that I needed to set some flags for the “MergeCells” command before making the call. But working out which flags and what to set them too …
ah, now there’s the question!

It may also be set programmatically, for the duration of some call, if needed.
Not by the method the OP used in his example. The dialog still appears even with the “ShowDialog” variable set to false in the argument array handed to “.uno:MergeCells” (today’s gotcha being that the post here uses wrong quotes not ASCII quotes). The dialog appears, and remains though the rest of the commands run through (moving the selection of cells around, at least) but nothing gets done.
I’ve only a couple of thousand lines of mangled data to fix. Doing it by hand will be quicker than solving the problem with a macro.