<κλάση header="doc-nav" aria-label="Πλοήγηση τεκμηρίωσης">
Τεκμηρίωση HotXLS
<κλάση nav="doc-links">
Περιεχόμενα
Αρχική
Επισκόπηση
IXLSWorkbook
TXLSWorksheets
<κλάση div="nav topic-quick-nav" aria-label="Topic shortcuts">
Αρχική
Περιεχόμενα
TXLSWorksheets
SheetByName μέθοδος
<κλάση div="indent">
<κλάση div="txt">
Επιστρέφει the worksheet object whose name matches the supplied sheet name, or
nil when no worksheet has that name. The classic XLS facade
uses the same name matching as the existing Index[SheetName]
property
Σύνταξη
<κλάση pre="code">
function SheetByName(SheetName: WideString): TXLSWorksheet;
function TryGetSheetByName(SheetName: WideString; out Sheet: TXLSWorksheet): Boolean;
Παράμετροι
<κλάση table="synd">
<κλάση td="syni">SheetName
<κλάση td="synid">The worksheet name to locate
<κλάση td="syni">Sheet
<κλάση td="synid">Receives the matching worksheet when TryGetSheetByName returns True; receives nil when no sheet matches
Return value
<κλάση div="txt">
The matching TXLSWorksheet
instance, or nil if the workbook does not contain a sheet with
that name. TryGetSheetByName returns True when a
match is found and False otherwise
Παράδειγμα
<κλάση pre="code">
var
Sheet: TXLSWorksheet;
begin
Sheet := Workbook.Worksheets.SheetByName('Summary');
if Sheet <> nil then
Sheet.Range['A1', 'A1'].Value := 'Ready';
if Workbook.Worksheets.TryGetSheetByName('Review', Sheet) then
Sheet.Range['A1', 'A1'].Value := 'Found';
end;
Δείτε επίσης
<κλάση div="txt">
κλάση TXLSWorksheets
TXLSWorksheets.Entriesιδιότητα
κλάση TXLSWorksheet
<κλάση footer="reference-footer">Copyright © 2010-2026 losLab Software