Quantcast
Channel: Apache OpenOffice Community Forum
Viewing all articles
Browse latest Browse all 1281

Macros and UNO API • userdefinedattributes

$
0
0
I'm following Andrew Pitonyak's example of setting and retreiving userdefinedattributes for a CALC cell but finding that the command to set that property is not doing anything. I'm wondering if this property has been deprecated, or the means to set it has been changed since Andrew did his research. The test code I'm trying is:

Code:

REM  *****  BASIC  *****Function Main(Arg1, Arg2)Dim CellObjectDim UDAcopyDim CellAttribute as New com.sun.star.xml.AttributeDataCellObject = thisComponent.Sheets(0).getCellByPosition(0,0)  'cell "A1"CellAttribute.Type = "CDATA"CellAttribute.Value = Arg1 + Arg2UDAcopy = CellObject.UserDefinedAttributesIf NOT UDAcopy.HasByName("AATRv") thenUDAcopy.InsertByName("AATRv", CellAttribute)ElseUDAcopy.ReplaceByName("AATRv", CellAttribute)End If'following statement gets no run time complaints but doesn't do anythingCellObject.UserDefinedAttributes = UDAcopyIf CellObject.UserDefinedAttributes.HasByName("AATRv") thenMain = CellObject.UserDefinedAttributes.getByName("AATRv").ValueElseMain = "no attribute found"End IfEnd Function
Am I missing something?

Statistics: Posted by Alex6361 — Thu May 09, 2024 8:00 am



Viewing all articles
Browse latest Browse all 1281

Trending Articles