Timing problem using Windows cmd scripts to run LO spreadsheets

asked 2019-03-13 19:36:09 +0200

Herb40 gravatar image

updated 2019-03-13 19:38:51 +0200

I use Windows .cmd scripts to successively process multiple spreadsheets using Basic macros. Each .cmd script causes the loading of a single SS and the execution of a series of macros, which typically create new sheets, load data into the sheets, evaluate the data in each sheet, summarize the results in another sheet, and create a new SS containing the results. Of course, the new SS document (call it oDoc in the Basic code) is subjected to oDoc.store and oDoc.close(True) and the original controlling SS is properly closed before terminating. I initiate all of this by executing a master .cmd script that does a "call" to execute each of individual .cmd scripts.

Processing a given SS that is loaded by its .cmd script usually takes about 15 seconds on my machine, and the overall sequence may run an hour or more (after I've gone to bed for the night). This usually works just fine, but in some cases the series of .cmd script just "hangs" in Windows Command Processor. Examining the Windows processes with Task Manager shows no LibreOffice processes at all, but examining the Command Processor itself reveals two LibreOffice processes (soffice.exe and soffice.bin), but neither is receiving any CPU time.

The hang-ups appear to occur primarily after a very large SS has been stored. My experience with OO and LO and Basic has been that only one instance of Basic can be executing at any given time. I think that what is happening is that the current .cmd script is terminating before all of the output caused by the oDoc.store has completed. The next .cmd script starts and runs soffice.exe, but soffice.exe sees that another instance and hangs. I can work around this problem by inserting a Basic Wait(millisecs) call after the oDoc.close(True) statement in order to provide time for things to "settle down," but this is a kludgy approach since a delay is usually not needed and the amount of time to waste is unknown.

So my questions are: "Is this problem known by others to exist?" and "Is there some condition I can test or UNO service I can call to wait until everything is completed?"

I am using LibreOffice 64-bit, Windows 10 64-bit with the latest updates from Microsoft, and JRE 1.8.0_201.

edit retag flag offensive close merge delete


I'm afraid that the only way to answer something here is if you create a bug report with some reliably reproducible steps (like "here's the script, and here's the test file; running this script against this file provokes the problem (at least in 20% cases)")...

Mike Kaganski gravatar imageMike Kaganski ( 2019-03-13 20:15:47 +0200 )edit