Board index » delphi » Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from Excel
Paul Saxton
![]() Delphi Developer |
Thu, 02 Sep 2004 09:21:13 GMT
|
Paul Saxton
![]() Delphi Developer |
Thu, 02 Sep 2004 09:21:13 GMT
Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from Excel
Hello!
I need to do the following to an Excel workbook through Delphi. Set the page adjustment level to 87% Can anyone provide a code snippet to do the above? Cheers Paul |
John Hil
![]() Delphi Developer |
Thu, 02 Sep 2004 23:00:21 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelThis doesn't answer the whole question but the following snippet does deal with margins. procedure SetPagePrintMargins(XLApp: TExcelApplication; XLChart: Quote"Paul Saxton" <psax...@onetel.net.uk> wrote in message Quote> Hello! |
Paul Saxto
![]() Delphi Developer |
Thu, 02 Sep 2004 17:11:22 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelHi John! What unit is TMargin declared in? I am using Excel 2000 with Delphi 5. Cheers Paul Quote"John Hill" <j...@jbeh.com> wrote in message news:3c943f4d_1@dnews... |
John Hil
![]() Delphi Developer |
Fri, 03 Sep 2004 12:47:27 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelPaul - You have misunderstood the parameters of my procedure - The newsgroup wordwrap doesn't help. TMargin is my abbreviation for the "top" margin parameter that I am passing So the call is something like. SetPagePrintMargins (MyExcelApp, MyChart, 0.75, 1.15 ,0.75 ,0.67 ); The *numbers* are the left , right , bottom and top margin values (expressed So for your example I'd call something like. SetPagePrintMargins (MyExcelApp, MyChart, 0.9, 0.9 ,1.0 ,1.0 ); (assuming you are working in inches) Quote"Paul Saxton" <psax...@onetel.net.uk> wrote in message Quote> Hi John! |
Paul Saxto
![]() Delphi Developer |
Fri, 03 Sep 2004 06:55:27 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelThanks for clearing that up John! That all works now, one more question though what is the value for A4 paper Cheers Paul Quote"John Hill" <j...@jbeh.com> wrote in message news:3c9501b0_1@dnews... |
John Hil
![]() Delphi Developer |
Fri, 03 Sep 2004 20:05:22 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelSuggest you try PageSetup.PaperSize := XLPaperA4; and while I'm at it I've found the way to set "orientation" PageSetup.Orientation := xlLandscape; All these variables can be easily found in the Excel Visual Basic Help file John Quote"Paul Saxton" <psax...@onetel.net.uk> wrote in message Quote> Thanks for clearing that up John! |
Paul Saxto
![]() Delphi Developer |
Fri, 03 Sep 2004 16:30:50 GMT
Re:Setting Page Adjustment, Page Orientation and Margins Of An Excel Workbook from ExcelThanks John! Quote"John Hill" <j...@jbeh.com> wrote in message news:3c956890_1@dnews... - Hide quoted text - - Show quoted text - Quote> > > > > This doesn't answer the whole question but the following snippet |
1. Setting Page header/footer and margins from printing html page
4. how can I set invisible of page control's page
6. How to set excel's page setup ?
7. New pages/mirror -- 5100+ links on Object-Orientation (English/French)
8. New pages and mirrors -- 4500+ links on Object-Orientation (English/French)
9. New pages/mirror/FRENCH version -- 4200+ links on Object-Orientation
10. New download page / 3900+ links about Object-Orientation