Could the Name.Area be changed by code
Posted: Mon Jan 20, 2014 2:18 am
Hi,
I have a excel file, there is a Name "resultset1" defined, then i use following code to update the Area of the Name, but it seems no changed. Can you help me on this? thanks!
Benny
I have a excel file, there is a Name "resultset1" defined, then i use following code to update the Area of the Name, but it seems no changed. Can you help me on this? thanks!
Code: Select all
xlsName := xlsApp.Names.Find('resultset' + inttostr(L+1));
if xlsName <> nil then
begin
xlsName.Area.SheetIndex := L;
xlsName.Area.Row1 := J;
xlsName.Area.Row2 := row-1;
xlsName.Area.Col1 := 0;
xlsName.Area.Col2 := pgPreview.ColCount-2;
xlsName.Update;
end
else
xlsApp.Names.Add('resultset' + inttostr(L+1), xlsSheet.Name, 0, J, pgPreview.ColCount-2, row-1);