+ Reply to Thread
Results 1 to 4 of 4

VBA Help with saving a worksheet as a pdf

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    17

    VBA Help with saving a worksheet as a pdf

    Hi there,

    I got the below code and it works great. I would just like to do some tweaking and need some help. I want to have the code save the active worksheet as a temp pdf, instead of bringing up the save dialog box. Here is the system I am working on. A form pops up which gathers information and puts it into a purchase order form which is a worksheet. The employee then clicks on a button to save the worksheet as a pdf into a directory determined by what information is gathered. A button to send a copy of the CSV worksheet to the accounting department, and finally I want a button that will have the worksheet sent off as a pdf to a particular vendor. This code works great, but I want to take the file naming away from employees so the file is saved in a special format. So for the pdf to be emailed off to the vendor, the file is already saved where it needs to be saved, in essence I just need something that coverts the worksheet to a pdf with a name that could stay the same such as purchase order and then the pdf could be erased after it was sent.

    I don't know if I am making this overly difficult, but its the system I came up with.
    Attached Files Attached Files
    Last edited by gjwilson1216; 10-30-2013 at 08:02 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA Help with saving a worksheet as a pdf

    Just dump the GetSaveAsFileName dialogue and build your own file name using the paths, file names and extensions you want.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: VBA Help with saving a worksheet as a pdf

    Appologies, I have no idea how to do that. I am an accountant by trade with very minimal VBA code expirience trying to satisfy a clients need. My idea was to fill in the Fixedfilepathname = "purchase order" and then attempted to get rid of the rest of the sequence and got an error on the end if line.

  4. #4
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: VBA Help with saving a worksheet as a pdf

    You need to understand what it is doing before you can make changes.
    This piece checks to see if FixedFilePathName has an answer.

    Please Login or Register  to view this content.
    ="" means no answer.

    All you have to do is give FixedFilePathName an answer before it gets to the question.

+ 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. [SOLVED] Saving worksheet using a macro. Problem is that it is saving more rows than it needs to
    By Kammphoto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 10:09 AM
  2. Need help saving a particular worksheet
    By BrianSells in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2012, 10:44 PM
  3. Saving worksheet
    By afortes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2010, 08:21 AM
  4. Replies: 9
    Last Post: 01-07-2009, 09:02 AM
  5. Saving Worksheet
    By Bobby28 in forum Excel General
    Replies: 2
    Last Post: 04-20-2005, 05:06 PM

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