![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PureBasic) XLSX Get Sheet NamesOpen an Excel spreadsheet (.xlsx) and get the names of the sheets. Note: This example requires Chilkat v11.3.0 or greater.
IncludeFile "CkStringTable.pb" IncludeFile "CkCsv.pb" IncludeFile "CkZip.pb" Procedure ChilkatExample() success.i = 0 ; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. ; .xlsx files are Zip archives zip.i = CkZip::ckCreate() If zip.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success = CkZip::ckOpenZip(zip,"qa_data/excel/fakeCompanies.xlsx") If success = 0 Debug CkZip::ckLastErrorText(zip) CkZip::ckDispose(zip) ProcedureReturn EndIf csv.i = CkCsv::ckCreate() If csv.i = 0 Debug "Failed to create object." ProcedureReturn EndIf sheetNames.i = CkStringTable::ckCreate() If sheetNames.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success = CkCsv::ckXlsxGetSheets(csv,zip,sheetNames) If success = 0 Debug CkCsv::ckLastErrorText(csv) CkZip::ckDispose(zip) CkCsv::ckDispose(csv) CkStringTable::ckDispose(sheetNames) ProcedureReturn EndIf i.i = 0 While i < CkStringTable::ckCount(sheetNames) Debug CkStringTable::ckStringAt(sheetNames,i) i = i + 1 Wend CkZip::ckDispose(zip) CkCsv::ckDispose(csv) CkStringTable::ckDispose(sheetNames) ProcedureReturn EndProcedure |
||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.