Excel page width in pixels?

J

John

I am setting up a formatted sheet to be a purchase order and am placing
several shape objects and such.

It would be helpful to know the maximum number of pixel that will fit onto
the printed page; of course depending on the page setup... paper size,
margins, etc.
Somewhere Excel decides whether a column will fit in the page area or print
on another page.

Is there an object that exposed this value? or even the paper size in
inches?

I tried to calculated it myself with
numOfChars = (Application.InchesToPoints(8.5) - (leftmrgn + rightmrgn))
/ (Application.StandardFontSize)

which incorrectly yields the value 46.1, when I can actually fit much more.

Also the .StandardFontSize is calculated on the present fonts "0" char. Is
it possible to find that number.

GOALS:
to be able to place items relative to the right margin
to be able to determine how many formatted columns I can fit on the page;
eg. Columns("A:E").width = pagesize / 5

any help would be appreciated
 
G

Guest

Greetings John,

You can find print setup for sheet from the
ActiveSheet.PageSetup.*
The papersize is located to
ActiveSheet.PageSetup.PaperSize
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top