Ask Your Question
0

LibreOffice maco windows to UNIX

asked 2015-02-23 20:13:53 +0100

alain.fontaine.566 gravatar image

I have a very simple macro running on Windows the code is the following


Sub open_FILE
     dim sCMD as String
     dim argument as string
     sCMD = "v:/tmp"
    'this shows the directry tmp in explorer windows
    oShell = createUnoService("com.sun.star.system.SystemShellExecute")
    argument=""
    oShell.execute(sCMD,argument,0)
End Sub

I want to execute this macro on Linux (mint) The macro is executed step wise and no error occurs but nothing is done I have modified my macro in order to execute a command


     sCMD = "gedit /home/mint/x.txt"

(this command is OK from the command line) but this is not executed Macro are authorized in both systems but when I open LO in win, it asks for macros, not in linux is that a clue? Can you help Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-02-23 22:11:40 +0100

w_whalley gravatar image

Your code worked when I put the text path in the augument:

sub open_file
dim sCMD as string
dim argument as string
sCMD="gedit"
oShell=createUnoService("com.sun.star.system.SystemShellExecute")
argument="/home/bill/words.txt"
oShell.Execute(sCMD,argument,0)
end sub

But even simpler

sub open_file2
shell("gedit /home/bill/words.txt",1)
end sub
edit flag offensive delete link more
0

answered 2015-02-24 16:41:48 +0100

alain.fontaine.566 gravatar image

I have reworked my example with you inputs. It is now working Thanks a lot

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-02-23 20:13:53 +0100

Seen: 145 times

Last updated: Feb 24 '15