I got an error message after updating Calc to LibO 3.5(.0 and still now with .1.2) when running a previously flawless macro. The offending (?) statement is .getCellRangeByName("namedcell") where namedcell is a global named cell range (of one cell, in this instance). Response from system: Basic runtime error. An exception occurred Type: com.sun.star.uno.RuntimeException Message:. The (empty) returned message is quite cryptic, without any error number to start searching. - Same error when tried with a multiple cells named range, and with different (plain and short) names for the range. - It works well when the named cell range is replaced by its coordinates value (e.g. "K12"). - Works also ok with getCellByPosition (but I want it to work correctly, as it did before, with a named cell range). Thanks in advance for a fast and complete solution, and/or explanation. Cheers.
I am getting the same error on 4.0.2.2 and previous release. I only get the error if I have deleted a range. The following code will recreate the problem. Sheet1 has a single range defined as "MYRANGE" and there is some data in the following cells. Sub Main Dim oSheet as Object DIM cBlock as New com.sun.star.table.CellRangeAddress dim myRow as integer oSheet = ThisComponent.sheets("Sheet1") myRow=oSheet.getCellRangeByName("MYRANGE").RAngeAddress.EndRow cBlock.Sheet=0 cBlock.StartColumn=0 cBlock.EndColumn=4 cBlock.StartRow=myRow+1 cBlock.EndRow=myRow+2 osheet.removeRange(cBlock, com.sun.star.sheet.CellDeleteMode.UP) myRow=oSheet.getCellRangeByName("MYRANGE").RAngeAddress.EndRow ' << fails here End Sub
Still a problem in 4.0.3.3
** 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-04-18
Repro per comment 1. Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+ Build ID: 01a189abcd9a4ca472a74b3b2c000c9338fc2c91 TinderBox: Win-x86@39, Branch:master, Time: 2015-06-14_07:46:28 Locale: fi-FI (fi_FI)
Changing version back to the earliest version affected.
** 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 with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. 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) from 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: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
(In reply to Jeremy from comment #1) > I am getting the same error on 4.0.2.2 and previous release. I only get the > error if I have deleted a range. > The following code will recreate the problem. Sheet1 has a single range > defined as "MYRANGE" and there is some data in the following cells. > > Sub Main > Dim oSheet as Object > DIM cBlock as New com.sun.star.table.CellRangeAddress > dim myRow as integer > > oSheet = ThisComponent.sheets("Sheet1") > myRow=oSheet.getCellRangeByName("MYRANGE").RAngeAddress.EndRow > > > cBlock.Sheet=0 > cBlock.StartColumn=0 > cBlock.EndColumn=4 > cBlock.StartRow=myRow+1 > cBlock.EndRow=myRow+2 > osheet.removeRange(cBlock, com.sun.star.sheet.CellDeleteMode.UP) > > myRow=oSheet.getCellRangeByName("MYRANGE").RAngeAddress.EndRow ' << fails > here > > End Sub I put numbers in A1-8 and defined A1-A4 as MYRANGE. I ran the macro and it did not fail. The macro removes two rows after the range. Is there something I am missing? Arch Linux 64-bit Version: 6.4.0.0.alpha0+ Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503 CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US Calc: threaded Built on 6 August 2019
Dear Kossem, 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 with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. 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) from https://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: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Eike: wasn't there a change that introduced sheet-local ranges [1]? Could that change be related to this? [1] https://wiki.documentfoundation.org/ReleaseNotes/3.4#Calc
Dear Kossem, 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 with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. 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) from https://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: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
As of LO 7.6 the macro in Comment #1 works fine if the document has a named range "MYRANGE". The macro will fail if the named range does not exist. So I'm closing this as WFM. Fell free to reopen if needed. Tested with Version: 7.6.4.1 (X86_64) / LibreOffice Community Build ID: 60(Build:1) CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Ubuntu package version: 4:7.6.4-0ubuntu0.23.10.1 Calc: threaded
Below is code that explains the problem that occurs when deleting cells with the RemoveRange(RangeAddress, com.sun.star.sheet.CellDeleteMode.UP) method and then accessing the cells with the GetCellRangeByName() or GetCellRangeByPosition() or GetCellByPosition() method. Response from system: Basic runtime error. An exception occurred Type: com.sun.star.uno.RuntimeException Message:. Dim oSheet1 As Object Dim oRange As Object Dim oRange2 As Object oSheet1 = ThisComponent.Sheets(0) ' Example 1: oRange = oSheet1.GetCellRangeByName("A15") oSheet1.RemoveRange(oRange.RangeAddress, com.sun.star.sheet.CellDeleteMode.UP) ' No BUG, because the deletion is performed in column A. oRange2 = oSheet1.GetCellRangeByName("A20") ' Example 2: oRange = oSheet1.GetCellRangeByName("X1") oSheet1.RemoveRange(oRange.RangeAddress, com.sun.star.sheet.CellDeleteMode.UP) ' No BUG, because the deletion is performed in row 1. oRange2 = oSheet1.GetCellRangeByName("A20") ' Example 3: oRange = oSheet1.GetCellRangeByName("B21") oSheet1.RemoveRange(oRange.RangeAddress, com.sun.star.sheet.CellDeleteMode.UP) ' No BUG, because the range requested by the next GetCellRangeByName() command is located above the row in which the deletion occurred (20 < 21). oRange2 = oSheet1.GetCellRangeByName("A20") ' Example 4: oRange = oSheet1.GetCellRangeByName("B20") oSheet1.RemoveRange(oRange.RangeAddress, com.sun.star.sheet.CellDeleteMode.UP) ' There is a BUG, because: ' 1) deletion is not in column A; ' 2) deletion is not in row 1; ' 3) range requested by the next GetCellRangeByName() command is located in the same row in which the deletion occurred, or below it (20 = 20, 65 > 20). oRange2 = oSheet1.GetCellRangeByName("A20") ' OR oRange2 = oSheet1.GetCellRangeByName("F65") Similar behavior with GetCellRangeByName("NamedRange"). Version: 25.2.2.2 (X86_64) / LibreOffice Community Build ID: 7370d4be9e3cf6031a51beef54ff3bda878e3fac CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win Locale: ru-RU (ru_RU); UI: ru-RU Calc: CL threaded
(In reply to Oleg from comment #12) Thanks Oleg, very informative. However, it needs clarification, if what you report is the same as this "LibO Calc Macro .getCellRangeByName with named range" (with emphasis on "named range"), or is it a separate issue. Your steps only mention "Similar behavior with GetCellRangeByName("NamedRange")", without a sample document with a pre-made range plus a code to test.
Let me address comment 12 in https://gerrit.libreoffice.org/c/core/+/184889.
Let me assume it fixed.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a0403b6eb25a99f6225e0f77f4b14d78f4045c9e tdf#47479: Do not modify range of sheet / column / row in notifications It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/1f3b872e8c4901ff36e07bb973e008f6849af21c tdf#47479: Do not modify range of sheet / column / row in notifications It will be available in 25.2.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 200643 [details] BUG after calling RemoveRange(UP).
Comment on attachment 200643 [details] BUG after calling RemoveRange(UP). The error occurs regardless of the method of getting the cell or (un)named range. If the target of the get is an (un)named range, the error also occurs if the removed cell was inside this range.