Rudolf Huber wrote:
Hallo,
the following sequence leads to an "indexoutofboundexception". In the beginning I have the opening statements:
Dim Desktop As Object
Dim Platzhalter()
Dim Url As String
Dim oTabellenDokument As Object Rem the entire
Document
Dim oTabellenListe As Object Rem Collection
of sheets
Dim Tabelle11 As Object Rem sheet
Dim Tabelle31 As Object Rem sheet
thereafter a little further down: :
oTabellenDokument = ThisComponent
oTabellenDokument.lockcontrollers
EndSpalte = ZellenBereich.EndColumn
EndZeile = ZellenBereich.EndRow
Desktop = CreateUnoService("com.sun.star.frame.Desktop")
Url = "file:///a:/test.ods"
oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0,
Platzhalter())
oTabellenListe = oTabellenDokument.getSheets()
Tabelle11 = oTabellenListe.getByIndex(0)
again further down, the table Tabelle31 throughs the index-error:
Tabelle31 = oTabellenListe.getByIndex(1)
Up version 2.4 I had no problem with a structure like this. Now, I have version
ooO 3. The table-collection oTabellenListe should allow various sheets,
however, macro stops after one table. In the sheet itself Tabelle1 in the
beginning; after the url the second sheet shows Tabelle1/1. Neither Tabelle11
nor the Tabelle31 - which I coded - appear on the sheet. I do not know, why the
macro ignores the definitions for the tables Tabelle11 und Tabelle31.
You said that more than one sheet exists in the document. What happens
if you do this?
Print oTabellenListe.getCount()
Print oTabellenDokument.getSheets().getCount()
Tabelle31 = oTabellenDokument.getSheets().getByIndex(1)
--
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]