+ Reply to Thread
Results 1 to 2 of 2

Excel page width in pixels?

  1. #1
    John
    Guest

    Excel page width in pixels?

    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



  2. #2
    Mr_Mani
    Guest

    RE: Excel page width in pixels?

    Greetings John,

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

    "John" wrote:

    > 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
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1