Get Sheet names with Symphony API using Lotusscript

Hi All,I am trying to read a Symphony Spreadsheet file using LotusScript through API. I am able to get hold of the number of sheets, but i am not able to retrieve the name of each sheet.

Also, in each sheet i can access the cells, but i am not able get the total rows in a given sheet.

Please help.

Regards,

Muthuselvan.

Code:


Set Me.objServiceManager = CreateObject(“com.sun.star.ServiceManager”)

Set Me.objDesktop = Me.objServiceManager.createInstance(“com.sun.star.frame.Desktop”)

Function GetSheetNames() As Variant

On Error Goto errgetname

Dim oSheet As Variant

Dim cnt As Integer

Redim Sheetname(Me.Spreadsheetscount-1) As String

For cnt = 0 To Me.Spreadsheetscount-1

	Set oSheet = Me.Symphonydoc.Sheets( cnt )	

	If Not (Isempty(oSheet) Or Isnull(oSheet) Or oSheet Is Nothing ) Then

		Sheetname(cnt) = oSheet.getName()

	End If

Next	

Me.GetSheetNames = Fulltrim(Sheetname)

Exit Function

errgetname:

Msgbox "Get Sheet - Error" & Str(Err) & ": " & Error$	& " @ " & Cstr(Erl)

Call CloseDocument()	

Exit Function

End Function


The below line of code is not working.

Sheetname(cnt) = oSheet.getName()

Also, oSheet.getRows().getCount() is not working as well.

Subject: Was able to find a solution

Instead of For cnt = 0 To Me.Spreadsheetscount-1

Set oSheet = Me.Symphonydoc.Sheets( cnt )

If Not (Isempty(oSheet) Or Isnull(oSheet) Or oSheet Is Nothing ) Then

Sheetname(cnt) = oSheet.getName()

End If

Next

i used these lines of code.

Set xsheets = Me.Symphonydoc.getSheets()

If Not (Isempty(xsheets) Or Isnull(xsheets) Or xsheets Is Nothing ) Then

For cnt = 0 To Me.Spreadsheetscount-1

Set oSheet = xSheets.getByIndex( cnt )

If Not (Isempty(oSheet) Or Isnull(oSheet) Or oSheet Is Nothing ) Then

Sheetname(cnt) = oSheet.Name

End If

Next

End If

That did the trick. I still do not have a solution to get the number of rows.