Hi, I'd like to use a macro to stop running an acrobat reader before creating a pdf.
I'm trying something like that :
oSys = CreateUnoService("com.sun.star.system.SystemShellExecute")
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe","",0)
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe", "kill",1)
or like this
shell("pkill C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe")
Or close the open file directly
address = ConvertToUrl(sPATH)
shell("pkill" & address)
The problem is that I want to overwrite the open PDF file, so I must close it first, otherwise the program ends with an error.
I don't know Shell at all, I'm just trying.
Can anyone help? Thanks
[Solved] How to kill proces
[Solved] How to kill proces
Last edited by lodovi on Mon May 06, 2019 9:54 pm, edited 2 times in total.
LibreOffice 5.2.2.2. OS Win 7
Re: How to kill proces
This question should be posted in macro area.
What is pkill? You want run a Unix command under Windows.
Remember that this kind of tool wait a PID and not a pathname.
What is pkill? You want run a Unix command under Windows.
Remember that this kind of tool wait a PID and not a pathname.
Re: How to kill proces
There's a couple of suggestions here:
https://stackoverflow.com/questions/183 ... n-from-vb6
http://www.vbforums.com/showthread.php? ... pplication
(vb6 code can often work or be adapted to OO so do a search for VB6 and what you want and you may get a solution)
https://stackoverflow.com/questions/183 ... n-from-vb6
http://www.vbforums.com/showthread.php? ... pplication
(vb6 code can often work or be adapted to OO so do a search for VB6 and what you want and you may get a solution)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 145
- Joined: Mon Jun 13, 2016 10:50 am
Re: How to kill proces
Hi,
This single line shoud work ("shell" is a basic runtime command):
More info on "taskkill": https://docs.microsoft.com/en-us/window ... s/taskkill.
Regards.
This single line shoud work ("shell" is a basic runtime command):
Code: Select all
shell("taskkill", 0, "/f /im AcroRd32.exe", True)
Regards.
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
Re: How to kill proces
Super, super, super It works absolutly great. Thank you very much everybody and especially hubert lambert
LibreOffice 5.2.2.2. OS Win 7