Apache OpenOffice (AOO) Bugzilla – Issue 101434
":" not handled when it appears immediately after "then"
Last modified: 2013-02-24 21:00:52 UTC
Openoffice version: 2.4.1 The spreadsheet available through the reported link contains VBA code that works well in EXCEL while it fails in CALC. CALC detects inexistent syntax issues in the VBA code. Please, open the spreadsheet and you will see the problem. Best Regards.
Created attachment 61893 [details] The provided http address links to this exact spreadsheet (untar, please).
Modified Version due to report. Not P1 I checked with "2.0.2 German version WIN XP: [680m5(Build9011)]" and indeed I saw many cells with an error message "'Makro?". No Idea whether this really is a VBA problem. @paolopiace: Thank you for your contribution. Before you file further issues or post again here, please read our guidelines on <http://qa.openoffice.org/issue_handling/pre_submission.html> and <http://www.openoffice.org/bugs/bug_writing_guidelines.html>, then contribute a clear step by step instruction.
My 3.1.0RC2 hangs when I try to open the sample document, I will file a separate issue for that problem.
I need to ask to rise this issue level to 4. This problem is impacting three groups of the same company: Armenia, California and Munich. Switching back and forth between the functioning Excel and Linux is a big deal.
yup I see the syntax error, unfortunately the document hangs ( even with macros non enabled ) so it is hard to see exactly where it is going wrong, need look into this further. I would suggest just not enabling macros for this document but it seems ( like someone else noticed ) that is seems to hang anyway
Negative. If you disable macros the spreadsheet opens and does not hang. Of course, not running the macros makes all cells appearing with unknown values. If you enable macros now, you will see the pop-up message of the syntsx error.
if you change the line If ID(j) Then: j1 = j1 + 1: b(i1, j1) = InputMtrx(i, j) ^ to If ID(j) Then j1 = j1 + 1: b(i1, j1) = InputMtrx(i, j) that should avoid the syntax error ( probably wont be the end of your problems though ) also this is not a vba issue per se but a general basic one ( treatment of ':' ) andreas, any idea? come across this before
The VBA language allows (legally) to write as many statements as the user wants on the same line. When doing this, statements must be separated by a colon. I did try the suggested correction before posting this issue on Apr 29. Then, I removed the colons and put the following statements on new lines. The initial syntax error on "j" disappeared but things (errors) in general became much worse and incomprehensible.
>The VBA language allows (legally) to write as many statements as the user wants >on the same line. When doing this, statements must be separated by a colon. ahem, OpenOffice basic is not VBA, it does have a VBA compatibility mode, regardless both OpenOffice basic and VBA share many common syntax, in this case it appears that handling of ':' for appending separate statements could be improved e.g. openoffice basic seems not to handle a ":" immediately after "then" ( as I have changed the bug summary to state ) >I did try the suggested correction before posting this issue on Apr 29. so, this is exactly the bug that you are reporting, why didn't you state that initially? ->ab can I pass this one to you ( well I just did ;-) ) >Then, I removed the colons and put the following statements on new lines. The >initial syntax error on "j" disappeared but things (errors) in general became >much worse and incomprehensible. so, as pointed out by rainerbielefeld you need to look at the guidelines for bugs, you need to help us help you, one bug per problem is the only sensible way to ensure help to clarify/track/fix/address each individual issue. Furthermore you can help by trying to breakdown those bugs by providing the smallest possible example that demonstrates the problem in a reproducible way. You understand the example that you provide better than we can and you are in a position to break it down better than us. Please help with that and open seperate issue for those you find.
2nd try to add this comment, so maybe it will appear twice afterwards... :-) Obviously this is no general problem with writing multiple statements in a line, but only with starting them with a colon instead of a statement because "Then" is not part of the statement list but belongs to the "If" statement. So I doubt that this problem will occur very often. Anyway I will have a look. -> NEW
STARTED, OOo 3.x