+ Reply to Thread
Results 1 to 3 of 3

VBA code for Printing to PDF - Need Help

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    South Carolina
    MS-Off Ver
    2010
    Posts
    10

    Question VBA code for Printing to PDF - Need Help

    Hello!

    I have a code that is used for printing a folder full of Excel files to PDF. This code makes sure that the full Excel workbooks are printed, and it does not crash unlike Adobe's batch printing service. The only problem is I can not stop it from prompting me for the save location. When I set an output folder in my Adobe PDF printing preferences, this is ignored by Excel for some reason. When I open one of the Excel files and go to "Printer Properties" (which is the Adobe PDF printer), it always shows "Prompt for Adobe PDF filename". This is despite going to the same Printing Preferences in Windows and specifying the save location. Since my preferences are being ignored, I thought I could get around it using the VBA script.

    I've tried using Application.SendKeys "~", but this doesn't appear to do anything. I am still prompted for a save location and have to press enter. This is unreasonable when I am dealing with hundreds of Excel to PDF conversions a day.

    Can I specify the save location within the VBA code? I have pasted what I have already below. I'm a novice to VBA so any help is greatly appreciated. Thank you!




    Please Login or Register  to view this content.
    Last edited by davesexcel; 04-03-2013 at 07:35 PM. Reason: Code Tags Required when show VBA Code, please read the forum rules

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: VBA code for Printing to PDF - Need Help

    If you are using a PDF printer chances are you will be promted for a file name.

    Your profile indicates that you are using Office 2010, since office 2007, you are able to save a workbook as PDF instead of using a PDF printer.

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    South Carolina
    MS-Off Ver
    2010
    Posts
    10

    Re: VBA code for Printing to PDF - Need Help

    Quote Originally Posted by davesexcel View Post
    If you are using a PDF printer chances are you will be promted for a file name.

    Your profile indicates that you are using Office 2010, since office 2007, you are able to save a workbook as PDF instead of using a PDF printer.
    So, can I save hundreds of Excel files at a time to PDF? Without a prompt for filename or save location?

+ 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