I would like to know if xlsReadWriteII is able to handle dynamic named ranges.
I mean named ranges that are using the OFFSET() function for their definition, for example:
Code: Select all
OFFSET(ref;0;0;nblines;nbcols)
Best regards,
Code: Select all
OFFSET(ref;0;0;nblines;nbcols)
Code: Select all
function TfMain.CheckExcelFile(AExcelFile: UnicodeString): Boolean;
var
i: Integer;
xName: TXLSName;
sheetIndex, row1, row2, col1, col2: integer;
begin
xlsReadWriteII5.LoadFromFile(AExcelFile);
for i:=0 to xlsReadWriteII5.Names.Count-1 do
begin
xName:= xlsReadWriteII5.Names.Items[i];
sheetIndex:= xName.Area.SheetIndex;
col1:= xName.Area.Col1;
Row1:= xName.Area.Row1;
col2:= xName.Area.Col2;
row2:= xName.Area.Row2;
//getting the values using sheetIndex, row1, row2, col1 and col2
end;
end;
Code: Select all
Sht := XLS.SheetByName('MySheet');
i := Sht.Index;