Problem description: When macro is executed, it is being executed line-by-line. Line normally is fully executable or fully commented. However, it is possible to include line such: (note: this is actual line I got in .xls file): ActiveWindow.SelectedSheets.PrintOut Copies:=1 ', Collate:= _ End Sub Now, after 'Copies:=1' the apostrophe means: "ignore the following text till end_of_the_line. The funny thing is that at the end of the line is an underscore, and actually it is BEING INTERPRETED. So in my situation: ... ActiveWindow.SelectedSheets.PrintOut Copies:=1 ', Collate:= _ End Sub Sub Print_with_grey_background() ... The following error pop-up appears: basic syntax error : sub not allowed within a procedure However, it is enough to duplicate 'End Sub', or delete underscore sign, and everything is fine. Steps to reproduce: 1. Description above should be enough 2. .... 3. .... Current behavior: When part of the line is commented out with single apostrophe sign, the 'underscore' sign at the end of the line is being parsed 'as designed' Expected behavior: When part of the line is commented out with single apostrophe sign, the 'underscore' sign at the end of the line should not be parsed Operating System: Windows 7 Version: 4.0.4.2 release
Hi Mateusz, Can you pls try this one? sub test67254 msgbox " test 67254" ', Collate:= _ End Sub end sub It behaves as expected for me: compains about the extra Sub end Remark that, and all is fine...
(In reply to comment #1) > Hi Mateusz, > > Can you pls try this one? > > sub test67254 > msgbox " test 67254" ', Collate:= _ > End Sub > end sub > > It behaves as expected for me: compains about the extra Sub end > Remark that, and all is fine... Hi Cor, Tanks for checking. Your script executes well in my LO, without complaining about an extra line. With two 'end sub' lines. So I guess my version still has a bug. My OS: Windows 7 Professional. Language: Polish LO version: 4.0.4.2 (Build ID: 9e9821abd0ffdbc09cd8c52eaa574fa09eb08f2) Polish language version. Regards, Mateusz
@Noel - thoughts here?
(In reply to comment #3) > @Noel - thoughts here? it is certainly a bug and since cor can't reproduce it with 'normal' macro calls one would have to suspect that this is a bug that is present in 'VBA' compatibility mode. Therefore I would imagine fairly low priority
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1 or later): https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-07-18
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.1.5 or 5.2.1 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20160920
In LO 5.2.3.3, I could not reproduce the bug. In addition, "ActiveWindow" is a method specific to MS-VBA.
Created attachment 131432 [details] extendedComment.xls: button macro with 'comment _ (In reply to Cor Nouws from comment #1) Here is an .xls document containing this macro... Private Sub CommandButton1_Click() MsgBox " test 67254" ', Collate:= _ End Sub It fails to compile/execute also on MSOffice 2003/2007/2013, so it seems like Microsoft ALSO evaluates an ending _ regardless of whether it is part of a comment or not. Closing this old issue. Please provide an example document that works in MSExcel, but fails in LO if you reopen it.