+ Reply to Thread
Results 1 to 4 of 4

macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer

  1. #1
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer

    I have a macro written in Excel 2003(poorly written by me), that prints two copies of Sheet1 to the default printer, and one copy to Adobe PDF printer.

    It works, but not like I envisioned. I have several problems

    1) I can't seem to get the default printer set back to default after printing

    2) The file name is picking up the name of Sheet1 rather than cell E1's value.

    3) It's writing the file location on the worksheet(Sheet1)..wherever the active cell may happen to be.

    4) I don't know what I'm doing.....LOL
    Attached Files Attached Files
    Last edited by jwright650; 01-27-2011 at 02:06 PM. Reason: Used Domski's code to print to PDF
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  2. #2
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer

    Here is the code in the macro that I tried to write:

    If anyone sees anything that I can do to fix my mess, I would appreciate the help.

    Please Login or Register  to view this content.

    If I can get this example sheet working correctly, I would like to adopt the code into Workbook that we currently have in use.
    Last edited by jwright650; 01-26-2011 at 08:23 AM.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer

    I think you need something lie the following. I've got Win2PDF, so it might be slightly different, you need to know the port that the Adobe PDF printer is on. My Win2PDF is on NE00: and this is the same for all users, I don't know if this will change for your software and if this is going to be used for multiple users with multiple printer this will be a pain.

    Anyhow, no harm trying the below, let me know if it works!

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer

    Thanks Kyle...I got it working, but I had to resort to copying someone else's efforts to make it work. I inserted a module and call it with my Userform cmdButton. When it writes the data to the worksheet, it also creates the pdf at the same time.

    I used: http://www.mrexcel.com/forum/showpos...3&postcount=11

    This works.

    Edited to work for me....

    Please Login or Register  to view this content.

+ 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