How do I run a batch file from a Calc spreadsheet?

CALC – I am running version of Libre Office. I want to run a batch file (with 2 arguments) from within a Calc spreadsheet. I was assuming that this can be done with the hyperlink command, but apparently is cannot. Can anybody here advise me as to how to make this work?

bencomp – Is there a more “detailed” manual for LO-BASIC? What background I have in programming deals more with FORTH and C – and that is many years ago. (I was a whiz in programming CP/M, DOS, and even RX-01 systems.) I do not seem to be able to get the SHELL() command to work. ???

Have you followed the link in the answer? I understand not understanding something can be frustrating, but try to show what you did to solve this problem, not what background you have as it doesn’t help understanding your problem. LibreOffice Basic Help - LibreOffice Help seems to be the starting point for Basic.

Running an executable (.BAT possible) by clicking a hyperlink calculated by HYPERLINK(): You have to know the full (absolute path) on your system. Then it will work.

Passing parameters: I don’t know a way. And there shouldn’t be one. (I also did a bit of research in that direction.)

Speaking of Windows: A standard installation uses well know paths for its system executables many of which can be called by any user. Think of one pretty dangerous (killing a lot of files …). The executable just sarted and nothing else shouldn’t do much harm. Working with parameters it might ruin everything. I think I’m better off if nobody can bait me with a hidden URL() of that kind anchored to a sweet piece of text.

[begin EDIT]

As any sufficiently powerful programming system Star(LibreOffice)Basic is providing means for executing program calls including those taking parameters. The Function of choice is named SHELL() and will return an error code (0 if no error). Cf Shell Function [Runtime] - LibreOffice Help The hint concerning ConvertToURL seems to be of no meaning under Win 8.

But there are issues in specific with calling CMD.exe .

You may use a tiny helper function I “programmed” . It is included in the attached example.

[end EDIT]

[begin EDIT2] Much more clear and self-explanatory. ask36180ShellExperiments002.ods [end EDIT2]

I have this rather large set of databases that are comprised of rather large (30+ MB) CAD data files. If I store them in a 7z file, a set of 195 part files compresses to about 200 MB. What I am trying to do is to walk the designer through selecting the appropriate CAD part file, extract it from the 7z archive, and activate it in the CAD system. The batch file works from the command line. I do know that the path to the 7z executable (“C:\Program Files\7-Zip\7z”) needs to be enclosed by quotation marks. So do the arguments. However, when I run it from the hyperlink command, I get an error message ("“J:\Lews_Data\Designs\Alibre_Standards\Sprockets\ANSI Sprockets\ExtractFile”" is not an absolute URL that can be passed to an external application to open it.) – ExtractFile is the name of the batch file.

Have you tried adding “.bat” to the script name? It may be invisible in Windows Explorer but still be part of the file name.