Code: Select all
with TXLSReadWriteII5.Create(self) do begin
Sheets[0].Name := 'Sheet Name';
Sheets[0].Autofilter.Add(0, 1, 1, 1);
end;
Code: Select all
with TXLSReadWriteII5.Create(self) do begin
Sheets[0].Name := 'Sheet Name';
Sheets[0].Autofilter.Add(0, 1, 1, 1);
end;
Code: Select all
var
N: TXLSName;
Col1,Row1,
Col2,Row2: integer;
SheetIndex: integer;
begin
Col1 := 0;
Row1 := 0;
Col2 := 0;
Row2 := 0;
SheetIndex := 0;
XLS[0].Autofilter.Clear;
XLS[0].Autofilter.Ref := SetCellArea(Col1,Row1,Col2,Row2);
N := TXLSName(XLS.Names.FindBuiltIn(bnFilterDatabase,SheetIndex));
if N = Nil then
N := TXLSName(XLS.Names.Add(bnFilterDatabase,SheetIndex));
N.Definition := '''' + XLS[0].Name + '''!' + AreaToRefStr(Col1,Row1,Col2,Row2,True,True,True,True);
N.Hidden := True;