![]() |
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
(PowerBuilder) 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.
integer li_rc integer li_Success oleobject loo_Zip oleobject loo_Csv oleobject loo_SheetNames integer i li_Success = 0 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. // .xlsx files are Zip archives loo_Zip = create oleobject li_rc = loo_Zip.ConnectToNewObject("Chilkat.Zip") if li_rc < 0 then destroy loo_Zip MessageBox("Error","Connecting to COM object failed") return end if li_Success = loo_Zip.OpenZip("qa_data/excel/fakeCompanies.xlsx") if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip return end if loo_Csv = create oleobject li_rc = loo_Csv.ConnectToNewObject("Chilkat.Csv") loo_SheetNames = create oleobject li_rc = loo_SheetNames.ConnectToNewObject("Chilkat.StringTable") li_Success = loo_Csv.XlsxGetSheets(loo_Zip,loo_SheetNames) if li_Success = 0 then Write-Debug loo_Csv.LastErrorText destroy loo_Zip destroy loo_Csv destroy loo_SheetNames return end if i = 0 do while i < loo_SheetNames.Count Write-Debug loo_SheetNames.StringAt(i) i = i + 1 loop destroy loo_Zip destroy loo_Csv destroy loo_SheetNames |
||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.