Page 1 of 1

Several print areas in one excel sheet

Posted: Tue Oct 28, 2008 3:06 pm
by GerdK
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:

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

Posted: Wed Oct 29, 2008 4:55 pm
by larsa
Hello

This is not possible right now, but it will be fixed in the next update.

Re: Several print areas in one excel sheet

Posted: Tue Dec 23, 2008 8:10 am
by GerdK
Hello,

is the update now available?

Regards,
Gerd

Re: Several print areas in one excel sheet

Posted: Wed Dec 24, 2008 7:05 am
by larsa
Yes.

Re: Several print areas in one excel sheet

Posted: Mon Dec 29, 2008 9:55 am
by GerdK
Hello,

is there an update for the version 3.0 available, or must I upgrade the version 3.0 to 4.0?
If there is an update available for the version 3.0, how can I download this?

Thanks for help!

Regards,
Gerd

Re: Several print areas in one excel sheet

Posted: Fri Jan 02, 2009 8:48 am
by larsa
Hello

Version 3 will not be updated.

Re: Several print areas in one excel sheet

Posted: Sat Jan 10, 2009 1:57 pm
by GerdK
Hello,

now I use the XLSReadWriteII component version 4.00.15 for Delphi 6. I use following code:

[code]
var
lXLS: TXLSReadWriteII4;
lInternalName: TInternalName;
lSheetIndex: integer;
begin
lXLS := TXLSReadWriteII4.create(nil);
try
lSheetIndex := 0;

lInternalName := lXLS.InternalNames.FindBuiltInName(bnPrintArea, lSheetIndex);
if not (assigned(lInternalName)) then begin
with lXLS.InternalNames.Add do begin
BuiltInName := bnPrintArea;
Definition := 'Inhalt!$A$1:$W$80;Inhalt!$A$91:$W$139;Inhalt!$A$150:$W$202;Inhalt!$A$213:$W$247;Inhalt!$A$258:$W$340;Inhalt!$A$351:$W$433;Inhalt!$A$444:$W$498;Inhalt!$A$509:$W$578';
end;
end else begin
lInternalName.Definition := 'Inhalt!$A$1:$W$80;Inhalt!$A$91:$W$139;Inhalt!$A$150:$W$202;Inhalt!$A$213:$W$247;Inhalt!$A$258:$W$340;Inhalt!$A$351:$W$433;Inhalt!$A$444:$W$498;Inhalt!$A$509:$W$578';
end;
finally
lXLS.free;
end;
end;
[/code]

At the command line "Definition := 'Inhalt!$A$1:$W$80;Inhalt!$A$91:$W$139;Inhalt!$A$150:$W$202;Inhalt!$A$213:$W$247;Inhalt!$A$258:$W$340;Inhalt!$A$351:$W$433;Inhalt!$A$444:$W$498;Inhalt!$A$509:$W$578';", I get the error "Name definition must be an area". When I use "Definition := 'Inhalt!$A$1:$D$10;Inhalt!$A$12:$D$20', I get no error.

If I set both print areas manually in the excel sheet, it works fine.
How can I set a large print area definition with the XLSReadWriteII component?

Many thanks for help!

Regards,
Gerd

Re: Several print areas in one excel sheet

Posted: Thu Apr 30, 2009 10:20 am
by GerdK
Hello,

I test it with Delphi 2007, MS Office 2003 and the XLSReadWriteII component version 4.00.15 (for Delphi 2007). I get the same error.
Is an update in planning which fix this error?

Many thanks for help!

Regards,
Gerd