Bug 47479 - LibO Calc Macro .getCellRangeByName with named range
Summary: LibO Calc Macro .getCellRangeByName with named range
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version: 4.0.3.3 release
Hardware: x86-64 (AMD64) Windows (All)
: high major
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-18 12:42 UTC by Kossem
Modified: 2013-12-08 11:51 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Kossem 2012-03-18 12:42:23 UTC
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.
Comment 1 Jeremy 2013-04-08 11:31:34 UTC
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
Comment 2 Jeremy 2013-05-16 09:46:20 UTC
Still a problem in 4.0.3.3


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.