+ Reply to Thread
Results 1 to 5 of 5

Unable to set the PaperSize property of the PageSetup class

  1. #1
    Registered User
    Join Date
    06-11-2014
    Posts
    3

    Question Unable to set the PaperSize property of the PageSetup class

    Hello,

    I'm trying to setup the PageSetup properties using VBA. All properties are working fine except the PaperSize property.
    I've used all XlPaperSize constants (xlPaper11x17, xlPaperLetter, etc.) and nothing works. I've also used the matching numbers instead of the constants with the same result. I then recorded a macro to grab the value for the paper size and got 134 for 11x17 size. If I use that value then it works but 134 is not one of the possible values for XlPaperSize as specified in the documentation.
    I'm a little bit confused as to what value I should be using. 134 works for me on my computer but it fails for another user on another machine for a different printer. 11x17 is supported on all printers.
    What I need to do is to be able to set the page size to 11x17 and that it will work for all users on all computers for all printers.

    Thank you for your help.
    Alain

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Unable to set the PaperSize property of the PageSetup class

    When I used the macro recorder (Excel 2003), the enumeration for 11 x 17 printer showed up as:
    Please Login or Register  to view this content.
    The printer is a Canon MF5700 series laser. It let me set up for 11 x 17, but I don't think it has the ability to feed 11 x 17 paper.

    Lewis

  3. #3
    Registered User
    Join Date
    06-11-2014
    Posts
    3

    Re: Unable to set the PaperSize property of the PageSetup class

    Hello Lewis,

    Unfortunately the macro recorder (Excel 2007) returned 134 (not xlPaper11x17). I have no idea where that value came from and why it's not one of the values specified in the documentation. I wish it would be as simple as what you got (and it should).

    Thanks for the help
    Alain

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Unable to set the PaperSize property of the PageSetup class

    Hi Alain,

    I would try 3.

    From the enumeration list I found, '3' makes sense as 11 x 17, since the first few paper sizes allocated were probably for the most common available at Microsoft many many years ago: http://www.datapigtechnologies.com/d...umerations.txt

    Excerpts from the list (rearranged in numerical order):
    xlPaperLetter = 1
    xlPaperLetterSmall = 2
    xlPaperTabloid = 3
    xlPaperLedger = 4
    xlPaperLegal = 5

    Lewis

  5. #5
    Registered User
    Join Date
    06-11-2014
    Posts
    3

    Re: Unable to set the PaperSize property of the PageSetup class

    Sorry Lewis, I tried them all, all the matching numerical values for each of the XlPaperSize constants, and none are working. But 134, which doesn't match any of the XlPaperSize constants, works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error 1004: Unable to set the PrintArea property of the PageSetup class
    By Morrigan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 10:11 PM
  2. Unable to set name property of Font Class
    By booo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2011, 05:46 PM
  3. Unable to set the Orientation property of the PageSetup class
    By Aero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2006, 09:10 AM
  4. [SOLVED] PageSetup.PaperSize
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2005, 03:06 PM
  5. [SOLVED] [SOLVED] Help - Error: Unable to set the PrintArea property of the PageSetup class
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2005, 10:06 AM

Tags for this Thread

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