Several print areas in one excel sheet
Posted: Tue Oct 28, 2008 3:06 pm
Hello,
we use the XLSReadWriteII component version 3.00.07 for Delphi 6. Now I want to set several print areas in one sheet. Code-example:
If I set the print areas manually in the excel sheet it works fine.
How can I set several print areas in one sheet with the XLSReadWriteII component?
Many thanks for help!
Regards,
Gerd K
we use the XLSReadWriteII component version 3.00.07 for Delphi 6. Now I want to set several print areas in one sheet. Code-example:
Code: Select all
var
lXLS: TXLSReadWriteII2;
lInternalName: TInternalName;
lSheetIndex: integer;
begin
lXLS := TXLSReadWriteII2.create(nil);
try
lSheetIndex := 0;
lInternalName := lXLS.InternalNames.FindBuiltInName(bnPrintArea, lSheetIndex);
if not (assigned(lInternalName)) then begin
lInternalName := lXLS.InternalNames.Add;
lInternalName.BuiltInName := bnPrintArea;
end;
lInternalName.Definition := 'Inhalt!$A$1:$W$81;Inhalt!$A$92:$W$136;Inhalt!$A$147:$W$199;Inhalt!$A$210:$W$244;Inhalt!$A$255:$W$333;'
+ 'Inhalt!$A$344:$W$423;Inhalt!$A$434:$W$484';
finally
lXLS.free;
end;
end;
If I set the print areas manually in the excel sheet it works fine.
How can I set several print areas in one sheet with the XLSReadWriteII component?
Many thanks for help!
Regards,
Gerd K