Record macro fails miserably

Just trying to record a pretty simple macro that hides some columns and it just works on the wrong ones. This was after I tried something more complex that hid columns, resized and wrapped text on one, then froze the first row. The last thing worked and the rest kept working on the wrong columns.

Does this work at all?

LibreOffice 7.3.2.2, MacOS 10.15.7

Please upload an ODF type sample file together with the embedded recorded macro.

The Macro recorder has a limited capability. Better to write your macros based on the API functions. (API: Application Programming Interface)

I appreciate the answer, but I’m not going to learn the API to do something I rarely use and should work out of the box. I’ll see about creating a simple case that it fails on, but I can’t share the data file.

I sincerely support your position! Do not under any circumstances do this if you do not feel that you are interested in it.

Moreover, the solution to this particular problem is easy to find right here or here or here.

Moreover, the solution to this particular problem is easy to find right here 1 or here 1 or here 1.

Thanks for this. The first had enough for me to make something work. Still not sure how to set the wrap text to true, but I’m hiding and changing column width which is the peskiest stuff to do manually.

Just add

.IsTextWrapped = True

to this code

PS. If the row-height is not sufficient after hyphenation, then you will be interested in this discussion.

That does it. Thanks so much.

I did search for that property name, but couldn’t find it.

No. The way it’s implemented makes it unusable, and the extent to which it’s implemented makes it mostly broken. Just don’t use it.