Shell() function crashes

This may be an OS problem, but I’m starting here because I’m very puzzled. I have an established database with many macros that I’ve had to restore to a new computer after a hard drive failure. OS is Ubuntu 18.04, same as original.

Only now, Shell() function always returns “file not found

A simple line like

Shell("/usr/bin/mousepad")

works fine on the old installation but not the new. The command works fine from the command line, but the function always causes a runtime error.

I guess somehow Libreoffice doesn’t understand the path. Have I neglected to set some parameter to tell it how to find file paths? I don’t remember having to do that before, but it was 3 years ago.

Any suggestions appreciated.

works fine on the old installation but not the new

And which LibreOffice version is this new? (and preferably also old, too)

And why “crashes” in the title, when you say it only refuses to execute/shows an error?

New one is 6.2.5.2. Not sure what the old one was, since it was on a hard drive that failed.

I do have another, older, computer that is running 6.0.7.3 and it does not have this problem.

The function “crashes” my macro, i.e. causes a run-time error that makes it stop working. Would you prefer “blows up”? Why split hairs?

Why split hairs?

Not sure what could that mean (not a native English speaker); but suspect that you somehow managed to apply some emotions to my clarification request (“why “crashes” in the title”) meant to understand if there’s actually some software crash (a term which has quite clear meaning in SW) that you just forgot to mention in the description (and then it’s a crasher bug), or was that just using a wrong term…

Have checked using

Sub MousePad
  Shell("/usr/bin/mousepad")
End Sub

on:

Version: 6.2.5.2, Build-ID: 1:6.2.5-0ubuntu0.18.04.1~lo1,CPU-Threads: 4; 
BS: Linux 5.0;  UI-Render: Standard; VCL: gtk3; Gebietsschema: de-DE (de_DE.UTF-8);
UI-Sprache: de-DE, Calc: threaded

and this doesn’t crash anything, nor show any file not found error. This just opened "mousepad* application. I do get a runtime error and file not found error, if I remove mousepad application using apt remove mousepad. Thus and your mention of "but not the new* make me feel, that you are on a new Ubuntu 18.04 system, which indeed hasn’t installed packahge "mousepad*, which in fact is not on Ubuntu’s default packages installed during base installation (Manual installation has been required before doing my test above).

jvglynnjr, were you using the snap or flatpak version of LibreOffice? There is a similar issue reported on Bugzilla: 153719 – 7.5 BASIC shell function fails (flatpak and snap versions)

Because a run-time Error can deliver an error Message, Sometimes only a Code wich may help learned people top find the cause. Also it is not the same as stop working ( maybe just waiting forever) or terminating or running in an exception or blocking the whole OS…
.
If all this ist not important - good luck top solve your Problem as there are already two ideas for a cause.