![]() |
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
(Unicode C) 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.
#include <C_CkZipW.h> #include <C_CkCsvW.h> #include <C_CkStringTableW.h> void ChilkatSample(void) { BOOL success; HCkZipW zip; HCkCsvW csv; HCkStringTableW sheetNames; int i; success = FALSE; // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. // .xlsx files are Zip archives zip = CkZipW_Create(); success = CkZipW_OpenZip(zip,L"qa_data/excel/fakeCompanies.xlsx"); if (success == FALSE) { wprintf(L"%s\n",CkZipW_lastErrorText(zip)); CkZipW_Dispose(zip); return; } csv = CkCsvW_Create(); sheetNames = CkStringTableW_Create(); success = CkCsvW_XlsxGetSheets(csv,zip,sheetNames); if (success == FALSE) { wprintf(L"%s\n",CkCsvW_lastErrorText(csv)); CkZipW_Dispose(zip); CkCsvW_Dispose(csv); CkStringTableW_Dispose(sheetNames); return; } i = 0; while (i < CkStringTableW_getCount(sheetNames)) { wprintf(L"%s\n",CkStringTableW_stringAt(sheetNames,i)); i = i + 1; } CkZipW_Dispose(zip); CkCsvW_Dispose(csv); CkStringTableW_Dispose(sheetNames); } |
||||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.