B4J Question Excel - how do you confirm a sheet name exists

mfstuart

Active Member
Licensed User
Longtime User
Hi all,
I'm just getting into using the XLUtils libraries and wanted to know how to confirm if a sheet exists in a spreadsheet.
I tried this but got stuck on establishing the workbook.

B4X:
        Dim XL as XLUtils
        XL.Initialize
        Dim workbook As XLWorkbookWriter = ??????   <<==== how to establish the workbook for an existing spreadsheet with many sheets?
        Dim sheets As List = workbook.PoiWorkbook.GetSheetNames
        
        Log("sheets.size: " & sheets.Size)
        
        If sheets.Size > 0 Then
            For i = 0 To sheets.Size
                Log(sheets.Get(i))
            Next           
        End If

Thanx in advance,
Mark Stuart
 
Top