Hello,
I can't find way to set name of the range.
SpreadSheetDocument have property NamedRanges (I need to get this property to set name of the ranges), but I can't find type SpreadSheetDocument in the CLI assemblies. There is only XSpreadSheetDocument, but unfortunately this interface haven't "NamedRanges" (Any other interface in the cli assembles haven't this property too).
Can anybody help me?
Thanks,
Anton Valter.
[Solved] [Calc] How can I set name of the range
[Solved] [Calc] How can I set name of the range
Last edited by Hagar Delest on Fri Mar 20, 2009 4:49 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OOo 3.0.X on Ms Windows XP + OpenSUSE 11.1
-
B Marcelly
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: How i can set name of the range. (Calc)
Hi,
As usual, read the Developer's Guide.
http://wiki.services.openoffice.org/wik ... med_Ranges
______
Bernard
As usual, read the Developer's Guide.
http://wiki.services.openoffice.org/wik ... med_Ranges
______
Bernard
Re: How i can set name of the range. (Calc)
Thanks.
I read few days ago. but i can't "translate" sample from java into C# next line:
com.sun.star.sheet.XNamedRanges xNamedRanges = (com.sun.star.sheet.XNamedRanges) UnoRuntime.queryInterface(com.sun.star.sheet.XNamedRanges.class, aRangesObj);
Because i haven't UnoRuntime object.. Do you have any idea?
I read few days ago. but i can't "translate" sample from java into C# next line:
com.sun.star.sheet.XNamedRanges xNamedRanges = (com.sun.star.sheet.XNamedRanges) UnoRuntime.queryInterface(com.sun.star.sheet.XNamedRanges.class, aRangesObj);
Because i haven't UnoRuntime object.. Do you have any idea?
OOo 3.0.X on Ms Windows XP + OpenSUSE 11.1
Re: How i can set name of the range. (Calc)
There is a text in the "DevGuide->Named Ranges": "The collection of named ranges is accessed using the document's NamedRanges property."
How i can get this property if i have object XSpreadSheetDocument?
Thanks.
How i can get this property if i have object XSpreadSheetDocument?
Thanks.
OOo 3.0.X on Ms Windows XP + OpenSUSE 11.1
Re: How i can set name of the range. (Calc)
Resolved.
// SpreadSheetDocument _doc;
unoidl.com.sun.star.beans.XPropertySet xps = _doc as unoidl.com.sun.star.beans.XPropertySet;
XNamedRanges namedrange = (XNamedRanges)xps.getPropertyValue("NamedRanges").Value;
namedrange.addNewByName("TEST", "$Sheet1.$A$1", new unoidl.com.sun.star.table.CellAddress(0, 1, 1), 0);
Thanks.
// SpreadSheetDocument _doc;
unoidl.com.sun.star.beans.XPropertySet xps = _doc as unoidl.com.sun.star.beans.XPropertySet;
XNamedRanges namedrange = (XNamedRanges)xps.getPropertyValue("NamedRanges").Value;
namedrange.addNewByName("TEST", "$Sheet1.$A$1", new unoidl.com.sun.star.table.CellAddress(0, 1, 1), 0);
Thanks.
OOo 3.0.X on Ms Windows XP + OpenSUSE 11.1