View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default EXcel Chart Size Probelm with Printer - Please Help

Best thing is to print the chart itself as a page. If you have a chart sheet
it's already set up like that. Its size (and shape) is defined by the paper
size and the margins, all of which you can change. An embedded chart on a
sheet can also be similarly printed, as a page. Select the chart and go into
print-preview. Size the margins to suit and press print.

Record a macro while doing the above to get the syntax. Though once you've
sized the margins and changed any other relevant print settings should
persist.

Regards,
Peter T

"Dennis Macdonald" wrote in message
...
I create via VBA a number of charts on an Excel sheet. I want to size
each of these to suit a single page of the printer. THe problem I have
is I cannot figure out the relationship between the Excel shape width
and the printer's printable width.

I have via a series of API got the printer's printable area and
converted to twips and points and as I understand Excel uses points as
its chart width and height.

I have setup a page in Excel manually with no margins and created a
chart and manually sized it to fit the page perfectly (and yes the
page setup is 100% scaling and zero on all margins). Below is the
numbers I get;

Directly from the API
--------------------------------
Printable Height (Pixels)= 14031
Page Width (Pixels)= 9920
Page Height (Pixels) = 14033
PrtTopNoPrint (Pixels) = 0
PrtLeftNoPrint (Pixels) = 0
Printer Resolution (DPI) = 1200 x 1200
TwipsPerPixelX = 1.2
TwipsPerPixelY = 1.2
PointsPerPixelX = 0.06
PointsPerPixelY = 0.06

Directly from the Shape Object
----------------------------------------------
Shape Width (Points) = 766.5
Shape Height (Points) = 610.5

Landscape Page Orientation gives:
---------------------------------------------------
Printable Width (Pixels) = 14031
Printable Width (Twips) = 16837.2
Printable Width (Points) = 841.86

WHY IS DIFFERENCE 766.5 and 841.86?

Please Help.

Thanks,
Dennis.