Apache OpenOffice (AOO) Bugzilla – Issue 29256
OOo crashes when executing macro
Last modified: 2013-02-24 21:09:58 UTC
Hi! I've got this macro: Sub Main ' normally here are some other instructions, ' so please don't ask: ' "Why should a macro only close this document?" ThisComponent.close(false) End Sub If I execute it, it does what I want: The document containing the macro closes. But if i assign it to the event "Open Document" and open the document, I get the following message box and OOo totally crashes: Title: Microsoft Visual C++ Runtime Library Text: Runtime Error! Program: C:\programme\openoffice680\program\soffice.exe abnormal program termination. Bye, Dominik Di Lorenzo Hugo Vogelsang GmbH & Co KG
SW->AS: it crashes indeed and I set the target to OOo2.0 since OOo1.1.1 doesn't crash ... seems something got broken on the way
Its fixed ... for the moment! But nobody can guarantee, that it will work tomorrow too. The reason: You close the document during(!) it was tried to be loaded. Because this event is called before loading is realy finished. The question is: is it usefull to close documents automaticly during loading ..? Please specify your requirements. May we find another (not so strange!) solution for you.
Hi! >Please specify your requirements. >May we find another (not so strange!) solution for you. Thanks for your offer. My problem: We're a company in the cold rolled steel industry. We've got some old COBOL programs running here. To get the data from those programs to OOo Calc, we do this: - make a CSV file in the COBOL program - call OOo from the COBOL program with "soffice f:\public\macro123.sxw" - those Writer-Files contain BASIC-macros that import the CSV Files with the correct character set, and (with help of templates) create a beautiful formated new "untitled1" calc document. - then the writer file (containing the macro) closes itself (and this is, where it crashed since OOo680) Ciao, Dominik Di Lorenzo dilorenzo@vogelsang-bandstahl.de Hugo Vogelsang GmbH & Co KG
.
AS->SW: Please verify it on my cws again. THX.
SW->AS: can't see any changes in fwk02ea the office still crashes :-(
reassigned
Hello Dominik! I've tried it ... but this task cant be realy fixed. Because this event is sent during loading of the document. If you close it, EVERY line of code inside our office must be aware to be killed! That would mean: we must implement a transaction handling ... which isnt realy possible without rewriting 100% of our code :-( From our point of view (and after reading your requirements) we say: dont do it in this way. But how can you do your job then? 1) You can implement a basic macro, which converts your CSV files via API. 2) Put it into the global basic container (not into the document). 3) Start your office with a macro-URL, which triggers the macro. 4) The macro itself does the following: sub startCSVConvertion on error goto HANDLE_ERROR doc = StarDesktop.loadComponentFromURL(...) convertCSV(doc) doc.close(false) rem Finish this job without an explicit office shutdown! exit sub HANDLE_ERROR: msgbox "Closing of document failed." end sub Regards Andreas PS: Fell free to ask me for further details by an email sent to as@openoffice.org!
Send it back to you.
Hello Dominik, please evaluate, if you can live with the workaround. If you can live with it, please close the task. I retarget this task to 'OOo later'.
After a discussion with Dominik, I close this task.