Ask Your Question

Close or Terminate Libreoffice - through coding [closed]

asked 2015-05-29 12:01:12 +0100

Lion gravatar image

updated 2015-08-27 12:20:04 +0100

Alex Kemp gravatar image

Hello All, My macro running through .ods file, When open .ODS file macro will execute and It will make another csv file which I called it "Output_file.CSV" and Output_file will close also But then I want to close my that file .ODS file, which I has opened it for execute macro

Simple when I click on .ods file , macro should be executed and after close both file output file and yes also .ODS file



edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-23 08:41:11.248573

1 Answer

Sort by » oldest newest most voted

answered 2015-07-26 05:34:10 +0100

doug gravatar image

After you have closed the file, as you know LO will continue to run in the background unless you tell it to terminate, the command for which is starDesktop.terminate. To create a clean shutdown, that does not later prompt for file recovery, a substantial Wait appears necessary prior to the terminate command because of an apparent race condition in LibreOffice. Your Wait may need to be longer, or it might be shorter. Thus the sequence ending with the clean terminate command would be:

Wait 400

Called by itself, the terminate command does generate a save prompt if the current document is modified, but the shutdown typically will be unclean due to the noted race condition.

(if this answers your question, please accept the answer by clicking the check (image description) to the left)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-05-29 12:01:12 +0100

Seen: 1,845 times

Last updated: Jul 26 '15