+ Reply to Thread
Results 1 to 5 of 5

VBA print problem

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    brussels
    MS-Off Ver
    Excel 2003
    Posts
    63

    VBA print problem

    Hello,

    Following code I use to print out my page on sheet 1. Now I have also a page on sheet 2 i want to print on the back.
    Can anyone help me to change the code please, i don't know exactly how to do this.

    Please Login or Register  to view this content.
    Many thanks
    Aquila
    Last edited by Aquila; 03-31-2010 at 10:18 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA print problem

    Hello Aquila,

    Neither Excel nor VBA has a built-in function to set your printer to "duplex" mode. Sometime ago I looked into how to do this. It requires using the Windows API. Copy all this code into a separate VBA module.
    Please Login or Register  to view this content.


    Using the Macro
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-09-2010
    Location
    brussels
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: VBA print problem

    Thankx Leith for fast reply!

    It's clear know, i could search a long time.


  4. #4
    Registered User
    Join Date
    12-23-2008
    Location
    Chennai,India,Tamilnadu
    Posts
    70

    Question Re: VBA print problem

    Dear Friend,

    Please help me to write VBA code for setting PDF creator as a default printer and PDF creation through that.


    Regards
    M.Velmurugan

  5. #5
    Registered User
    Join Date
    02-21-2010
    Location
    Italy
    MS-Off Ver
    Excel 2013
    Posts
    77

    Re: VBA print problem

    Hi there,
    @ Leith Ross, I think your code is great!
    I tried your code at work but I have some problems to access the printers.
    We're on a LAN network and all of our printer have a static IP, I have policies to access all of them since they're in the root of our server. I run the pc as Local Administrator.
    I can access and print in all of the printers, but as soon as I run the SetPrinterToDuplex function I get a "Access denied - see the article for more info" message.
    Please, can you help me in the process to implement this very useful function?

    thanks in advance
    P.

+ 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