Sample code for 30+ languages & platforms
B4X Requires Chilkat v11.3.0+

XLSX Get Sheet Names

Open an Excel spreadsheet (.xlsx) and get the names of the sheets.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

'  This example assumes the Chilkat API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

'  .xlsx files are Zip archives
Dim zip As ChilkatZip
zip.Initialize("zip")
success = zip.OpenZip("qa_data/excel/fakeCompanies.xlsx")
If success = False Then
    Log(zip.LastErrorText)
    Return
End If


Dim csv As ChilkatCsv
csv.Initialize
Dim sheetNames As ChilkatStringTable
sheetNames.Initialize
success = csv.XlsxGetSheets(zip, sheetNames)
If success = False Then
    Log(csv.LastErrorText)
    Return
End If


Dim i As Int = 0
Do While i < sheetNames.Count
    Log(sheetNames.StringAt(i))
    i = i + 1
Loop