Board index » delphi » Printing from Excel - Setting Papersize

Printing from Excel - Setting Papersize

Hi there,

I'm trying to print out a large (A1) StringGrid and the path of least
resistance seems to be through Excel.

I've got this bit to work OK through OLEAutomation.

var Sheet::Variant;

sheet .PageSetUp.Orientation:=2;
sheet.PageSetUp.printArea:='A1:AO15';

but I can't get this to work

sheet.PrintSetUp.PaperSize:=xlPaperDSheet;

I've tried making xlPaperDSheet a constant of 25 (from the lib browser) and
many other variations including
sheet.xlPaperSize:=xlPaperDSheet; and so on.

I must be missing out something but I can't see it.

I would also like to get the ActivePrinter bit to work as well but that's
still eluding me..

Anybody got any thoughts?

Ian Millward
Edinburgh

 

Re:Printing from Excel - Setting Papersize


Quote
> but I can't get this to work

> sheet.PrintSetUp.PaperSize:=xlPaperDSheet;

OK now, I was declaring the Const value in the wrong place. Still having
problems with getting the printer set up to work. Any ideas?

Ian Millward

Re:Printing from Excel - Setting Papersize


<<Ian Millward:
Still having problems with getting the printer set up
to work. Any ideas?

Quote

Not without being told what the problems are, no. :)

--
Deborah Pate

Other Threads