Alle 17:19, sabato 27 gennaio 2007, Johnny Andersson ha scritto:
[...]
> By the way, do you happen to know if there is a better way to check if a
> cell range is empty than the following?
>
> Dim Blah As Variant
> Blah=ThisComponent.Sheets.getByIndex
> (0).getCellRangeByPosition(0,2,1,2).getDataArray()
> If IsEmpty(Blah) Then
>    {Do something}
> EndIf

I have never tried this way.
it would seem not so bad, except for the poor performance in case of very big 
cell range. (I'm guessing but I'm not 100% sure anyway)

Personally I would try with one of the query* methods, for example :

iCellAttr = _
        com.sun.star.sheet.CellFlags.VALUE + _
        com.sun.star.sheet.CellFlags.DATETIME + _
        com.sun.star.sheet.CellFlags.STRING + _
        com.sun.star.sheet.CellFlags.ANNOTATION + _
        com.sun.star.sheet.CellFlags.FORMULA + _
        com.sun.star.sheet.CellFlags.HARDATTR + _
        com.sun.star.sheet.CellFlags.STYLES + _
        com.sun.star.sheet.CellFlags.OBJECTS + _
        com.sun.star.sheet.CellFlags.EDITATTR + _
        com.sun.star.sheet.CellFlags.FORMATTED
        
oQueryResult = thisComponent.CurrentSelection.queryContentCells(iCellAttr)
print oQueryResult.count



ciao
Paolo M

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to