Up to LO 24.2. the following command runs well: oShell = createUnoService("com.sun.star.system.SystemShellExecute") stField = convertToUrl(home/user/myfile.png) oShell.execute(stField,,0) Since LO 24.8 it will execute, but an error appears: "Argument isn't optional". The error could be suppressed by setting oShell.execute(stField,3,0) or some other value, but in help for LibreOffice you could still read the second argument is optional. Have read the release notes for LO 24.8 but there is no note for this different behavior. Bug appears in Version: 24.8.2.1 (X86_64) / LibreOffice Community Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13 CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: de-DE Calc: threaded also in Windows systems, but not in LO 24.2.5 on this system and on Windows systems
The XSystemShellExecute::execute method documentation [1] has no mention of any "optional" argument - I write this, because your comment o shows the example of its use. But reading the bug title: it's "Function Shell report an optional argument as not optional". So the question is: what is this bug about: Shell function [2], or XSystemShellExecute::execute? And which help page is mentioned? [1] https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1system_1_1XSystemShellExecute.html#af7a73d7840dfafddb1bfb0e10c4ec8e0 [2] https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03130500.html?DbPAR=BASIC
(In reply to Mike Kaganski from comment #1) > So the question is: what is this bug > about: Shell function [2] > [2] > https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03130500. > html?DbPAR=BASIC Here the content: ––––––––––– Windowstyle Optional integer expression that specifies the style of the window that the program is executed in. –––––––––– All arguments except Pathname (first argument) are marked as optional. Worked this way in all versions before LO 24.8. this way.
(In reply to Robert Großkopf from comment #2) But your comment 0 does not use Shell function at all?
(In reply to Mike Kaganski from comment #3) > (In reply to Robert Großkopf from comment #2) > > But your comment 0 does not use Shell function at all? Indeed, I didn't recognize the difference. So it is really https://bugs.documentfoundation.org/show_bug.cgi?id=162431 which is solved now and brings up all the errors here, because I have set the second parameter as nothing. oShell.execute(stField,,0) Have to fix many databases, which use this code… Should we close this one as "NOTABUG"?
(In reply to Robert Großkopf from comment #4) > Should we close this one as "NOTABUG"? Let's do it :-)