+ Reply to Thread
Results 1 to 7 of 7

Macro to Print a PDF File (using PDF Writer) to a Network Folder

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Macro to Print a PDF File (using PDF Writer) to a Network Folder

    Hi,

    Can anybody assist me with the macro code to print a range from a worksheet e.g. A1:H24 in a PDF format to a network folder.

    The scenario is as follows :-

    Currently my team are printing hard copies of data e.g. the range of data A1:H24 to a network printer, however, I have now been told that the Network Printer list includes a ‘PDF Writer’ which allows you to save your data in a PDF format and save to either you own PC or a network folder.

    What I require is macro code to select the ‘PDF Writer’ from a list of Network Printers and save to a network folder called P:\Procurement\Wafs using the data in cell N1 as the file name


    Any assistance would be greatly appreciated.


    Many thanks


    Rob
    Rob

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    Did you try recording a macro?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-31-2009
    Location
    Philadelphia, PA
    MS-Off Ver
    All of them
    Posts
    4

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    This one is a little tougher than it sounds. Here is the function you need:


    _______________

    Please Login or Register  to view this content.
    ______________


    Use it like this:

    Please Login or Register  to view this content.
    __________________________


    I have this code in a few workbooks that run daily, so I know it works.
    Last edited by NULL_ReferenceExcept; 07-31-2009 at 11:17 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    NRE

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    Null,

    many thanks for your reply, however, I get the error message 'User -Defined type not defined' when I run the macro.

    Any ideas ? I have also attached my workbook

    Rob
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-07-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    I have a similar problem. I want my macro to print to a pdf file. I tried recording the macro and this is what it suggested. However, when I try to open the pdf file I get an error message that says the file is incompatable or corrupted. Below is the code I have used for the macro, any suggestions on how to fix this problem? The code I am using is placed within a "do" loop. My intent is that the name of the pdf file would be taken from the value in the cell named "FileName2".


    Application.ActivePrinter = "CutePDF Writer on CPW2:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
    "CutePDF Writer on CPW2:", PrToFileName:=Range("FileName2").Value

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to Print a PDF File (using PDF Writer) to a Network Folder

    drse,

    Please take a few minutes to read the forum rules, then start your own thread with your code enclosed in code tags.

    Thanks.

+ 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