[api-dev] getCellAddress() returns garbage

2006-12-21 Thread Andrew Douglas Pitonyak

Is the method getCellAddress() deprecated?
I am not able to obtain valid results. For example, I ran the following 
macro on FC6 (with what ever came with the system, which means I am 
still on 2.04 with a fedora supplied build)


Sub TestCellAddress
 Dim oCell
 Dim oAddress
 oCell = ThisComponent.Sheets(0).getCellByPosition(2, 3)
 oAddress = oCell.getCellAddress()
 MsgBox "Sheet = " & oAddress.Sheet & CHR$(10) & _
"Column = " & oAddress.Column & CHR$(10) & _
"Row = " & oAddress.Row
End Sub

Returned:

Sheet = -2268
Column = 32767
Row = -1189158716


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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



Re: [api-dev] getCellAddress() returns garbage

2006-12-21 Thread Cor Nouws

Hi Andrew,

Andrew Douglas Pitonyak wrote:


Is the method getCellAddress() deprecated?
I am not able to obtain valid results. For example, I ran the following 
macro on FC6 (with what ever came with the system, which means I am 
still on 2.04 with a fedora supplied build)


Sub TestCellAddress
 Dim oCell
 Dim oAddress
 oCell = ThisComponent.Sheets(0).getCellByPosition(2, 3)
 oAddress = oCell.getCellAddress()
 MsgBox "Sheet = " & oAddress.Sheet & CHR$(10) & _
"Column = " & oAddress.Column & CHR$(10) & _
"Row = " & oAddress.Row
End Sub

Returned:

Sheet = -2268
Column = 32767
Row = -1189158716


Returns 0, 2, 3 for me. Thus OK.
And when I use
   oCell = ThisComponent.getCurrentSelection()
I also retrieve the correct (selected) address.

This with OOo 2.1 / XP
So maybe your system is just in need for a little break ;-)

Best wishes,

--

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

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