Ask Your Question

Running macro in centos [closed]

asked 2016-08-04 00:48:44 +0200

Ramv gravatar image

updated 2020-07-21 06:03:56 +0200

Alex Kemp gravatar image

I am trying to run the following macro which i picked form to set optimal column widths on a docx file.

I am running soffice inside docker on centos7 . Yum installed libreoffice-headless- and libreoffice-writer- Copied the xba file to /usr/lib64/libreoffice/presets/basic/Standard/OptimizeColumnWidth.xba . '

Command being executed is soffice --headless Test.docx "macro:///Standard.OptimizeColumnWidth.OptimizeColumnWidthSaveQuit()" . The execution hangs until i press ctlr+c . I dont think the macro is even run.

If i run the same macro on Mac , /Applications/ --headless ~/Desktop/Test.docx "macro:///Standard.Module1.OptimizeColumnWidthSaveQuit()" , the macro modifies the tables in Test.docx and saves it.

So wondering what i am missing here.

PS: i dont see the ~/.config folder until i run soffice. After i run soffice for the first time , i see it and it contains the macros. I dont see a permission issue too on the ~/.config path.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-07-21 06:04:08.076730

1 Answer

Sort by » oldest newest most voted

answered 2016-08-23 21:34:35 +0200

mark_t gravatar image

Basing this suggestion on debug using Windows or Linux Mint as I don't have Centos, but hopefully this still helps identify the problem.

Try it first without "--headless" to see if you are missing error messages or some query for confirmation etc.

You can also try

soffice Test.docx

to confirm it opens your document.

Check if it's an error in the macro by opening the Basic IDE, then set a breakpoint at the beginning of the macro. If you then run :

soffice "macro:///Standard.OptimizeColumnWidth.OptimizeColumnWidthSaveQuit()"


soffice Test.docx "macro:///Standard.OptimizeColumnWidth.OptimizeColumnWidthSaveQuit()"

You should see the macro stop at the breakpoint and you can then step through while checking for errors.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-08-04 00:48:44 +0200

Seen: 441 times

Last updated: Aug 23 '16