Page 1 of 1

restrict printing area

Posted: Fri Dec 15, 2006 3:03 am
by Guest
Hi!
How can I restrict printing area? e.g. I have filled 10 colums on my grid, and I need print only first 8 columns.

Posted: Mon Dec 18, 2006 7:36 am
by larsa
Hello

How do you do it in excel?


Lars Arvidsson

Posted: Tue Dec 19, 2006 10:21 am
by Guest
Hello!
I have russian version of ms office 2003. Sorry for some small mistakes in description (if they would).

I select some area by mouse in my excel-document. Then I press menu item File/Print Area/Set. And when I try to show print preview, excel show me only fields, witch are in selection area.

Posted: Thu Dec 21, 2006 8:36 am
by larsa
Hello

You set the print are with IntrnalNames. Example:

Code: Select all

  with XLS.InternalNames.Add do begin
    BuiltInName := bnPrintArea;
    Definition := 'Sheet1!$D$4:$G$10';
  end;
Lars Arvidsson

Posted: Wed Mar 14, 2007 10:57 am
by Guest
Hello!

Why at opening a file there is a mistake?

Code: Select all

           xls.Filename := 'c:\1.xls';
           xls.Sheets[0].Name := 'A';
            with xls.InternalNames.Add do
             begin
                BuiltInName := bnPrintArea;
                Definition := 'A!$D$4:$G$10';
             end;
              xls.Sheets.Add;
              xls.Sheets[1].Name := 'S';
            with xls.InternalNames.Add do
             begin
                BuiltInName := bnPrintArea;
                Definition := 'S!$D$4:$G$10';
             end;

              xls.Sheets.Add;
              xls.Sheets[1].Name := 'D';
            with xls.InternalNames.Add do
             begin
                BuiltInName := bnPrintArea;
                Definition := 'D!$D$4:$G$10';
             end;