basic won't access spreadsheet row > 255

Bug #173891 reported by Steve Franks
4
Affects Status Importance Assigned to Milestone
openoffice.org (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: openoffice.org

I have written a Basic macro to process data in a spreadsheet and the following command fails with a Basic Index Out of Bounds runtime error:
       cell= Sheet.getCellByPosition(k, 0)
If k is greater than 255, even though I have 715 rows in the relevant sheet.

Revision history for this message
Steve Franks (stevef48) wrote :
Revision history for this message
Steve Franks (stevef48) wrote :

Openoffice in Windows XP does exactly the same .

Revision history for this message
Chris Cheney (ccheney) wrote :

Do you still have this problem with OpenOffice.org 2.4.0~rc2 which is in Ubuntu hardy (or on XP)?

Thanks,

Chris Cheney

Changed in openoffice.org:
assignee: nobody → ccheney
status: New → Incomplete
Revision history for this message
Steve Franks (stevef48) wrote : Re: [Bug 173891] Re: basic won't access spreadsheet row > 255

Yes, it still occurs in 2.4.0rc2 for XP. I haven't successfully
installed it on my Ubuntu laptop yet.

Regards
Steve

Chris Cheney wrote:
> Do you still have this problem with OpenOffice.org 2.4.0~rc2 which is in
> Ubuntu hardy (or on XP)?
>
> Thanks,
>
> Chris Cheney
>
> ** Changed in: openoffice.org (Ubuntu)
> Assignee: (unassigned) => Chris Cheney (ccheney)
> Status: New => Incomplete
>
>

Revision history for this message
Chris Cheney (ccheney) wrote :

Can you attach an example document that exhibits this problem? The smaller the better, it doesn't have to have real data, it can be dummied up, etc.

Thanks,

Chris Cheney

Revision history for this message
Steve Franks (stevef48) wrote :
  • Tags2.ods Edit (34.8 KiB, application/vnd.oasis.opendocument.spreadsheet)

It isn't very big and the data isn't confidential.
Regards
Steve

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Chris Cheney
Sent: 20 March 2008 20:47
To: <email address hidden>
Subject: [Bug 173891] Re: basic won't access spreadsheet row > 255

Can you attach an example document that exhibits this problem? The
smaller the better, it doesn't have to have real data, it can be dummied
up, etc.

Thanks,

Chris Cheney

--
basic won't access spreadsheet row > 255
https://bugs.launchpad.net/bugs/173891
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
Chris Cheney (ccheney) wrote :

Thanks!

Chris

Changed in openoffice.org:
assignee: ccheney → nobody
status: Incomplete → New
Revision history for this message
Chris Cheney (ccheney) wrote :

I believe that this bug has been corrected in Ubuntu hardy openoffice.org 1:2.4.0~rc2-1ubuntu3 so I am marking it as Fix Released. If after upgrading you continue to have problems with this issue then feel free to reopen this bug.

I at least don't see any errors when opening the document, is the error not shown generally, do I have to look somewhere in specific to see if it is working or not?

Thanks,

Chris Cheney

Changed in openoffice.org:
status: New → Fix Released
Revision history for this message
Steve Franks (stevef48) wrote :

It only appears when the macro runs.
Regards
Steve

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Chris Cheney
Sent: 26 March 2008 01:20
To: <email address hidden>
Subject: [Bug 173891] Re: basic won't access spreadsheet row > 255

I believe that this bug has been corrected in Ubuntu hardy
openoffice.org 1:2.4.0~rc2-1ubuntu3 so I am marking it as Fix Released.
If after upgrading you continue to have problems with this issue then
feel free to reopen this bug.

I at least don't see any errors when opening the document, is the error
not shown generally, do I have to look somewhere in specific to see if
it is working or not?

Thanks,

Chris Cheney

** Changed in: openoffice.org (Ubuntu)
       Status: New => Fix Released

--
basic won't access spreadsheet row > 255
https://bugs.launchpad.net/bugs/173891
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
Chris Cheney (ccheney) wrote :

Unless I am missing something there isn't even any macros in this attached file. I turned macro security to warn and opened the file and it didn't claim there were any macros, and I looked in the Run Macro area and it didn't list that there were any macros in the file.

Revision history for this message
Steve Franks (stevef48) wrote :
  • Tags3.ods Edit (36.2 KiB, application/vnd.oasis.opendocument.spreadsheet; name="Tags3.ods")

That's odd.
I've only just started programming with OpenOffice, so probably did something stupid.
The macro was stored somewhere else, but I've now moved it into the spreadsheet and set it to run when the document is opened.
It generates an error as soon as the index exceeds 255. The error lies in Uno Service.
I guess that the for loop index has been typed as a byte, instead of long, or integer.
Regards
Steve

The Text of the macro is:
public const maxi = 714
public const starti = 1
public ccell as object
dim cr as integer 'current cell's row
public cc as integer 'current cell's current

rem ----------------------------------------------------------------------
rem define variables
public dispatcher, document, desktop as object

rem ----------------------------------------------------------------------

rem get access to the document

public Sheet As Object
public Cell As Object
public Obj As Object

sub main

 document = ThisComponent'.CurrentController.Frame
 dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------

 Sheet = document.Sheets.getByName("Sheet1")

'
 for cr=250 to maxi
  cCell = Sheet.getCellByPosition(cr, 1)

 Next
End Sub

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Chris Cheney
Sent: 27 March 2008 17:49
To: <email address hidden>
Subject: [Bug 173891] Re: basic won't access spreadsheet row > 255

Unless I am missing something there isn't even any macros in this
attached file. I turned macro security to warn and opened the file and
it didn't claim there were any macros, and I looked in the Run Macro
area and it didn't list that there were any macros in the file.

--
basic won't access spreadsheet row > 255
https://bugs.launchpad.net/bugs/173891
You received this bug notification because you are a direct subscriber
of the bug.

Chris Cheney (ccheney)
Changed in openoffice.org:
status: Fix Released → New
Revision history for this message
Steve Franks (stevef48) wrote :

This bug is still present in the version 2.4.0. release.

Revision history for this message
Chris Cheney (ccheney) wrote :

Do you still have this problem with openoffice.org 1:2.4.1-1ubuntu2 in Ubuntu 8.04?

Changed in openoffice.org:
status: New → Incomplete
Revision history for this message
Steve Franks (stevef48) wrote :

Chris Cheney wrote:
> Do you still have this problem with openoffice.org 1:2.4.1-1ubuntu2 in
> Ubuntu 8.04?
>
> ** Changed in: openoffice.org (Ubuntu)
> Status: New => Incomplete
>
>
No, it was my mistake all along.
If you look at the code sample I sent, you'll see that I had transposed
the row and column indexes. They are the other way round in Microsoft VBA.
The error occurred when the column index reached 256.
Regards
Steve

Chris Cheney (ccheney)
Changed in openoffice.org:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.