+ Reply to Thread
Results 1 to 8 of 8

save as pdf in current path?

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    78

    save as pdf in current path?

    Hi all, Hoping someone can help me out with a little addition to my macro.

    I currently have a macro that after running opens up a save as dialogue box so i can save the file in the specific folder i need to. Is there a way to add that filepath (after i have saved it somewhere) to a variable, so that it will save a pdf copy as well?(after i have saved it in the location i want to?)

    Thanks for yalls help!

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: save as pdf in current path?

    do you want the saveas dialogue or do you want set filename/path elsewhere in the code and not use the dialogue at all?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: save as pdf in current path?

    Heres code i use for my pdf/saveAs macro

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-14-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    78

    Re: save as pdf in current path?

    I actually have the getsaveas dialogue pop up to save the excel file beforehand, so if it could just save a copy as a pdf that would work the best. Is that what your code does?

  5. #5
    Registered User
    Join Date
    05-14-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    78

    Re: save as pdf in current path?

    My current code seems to let me choose where to save it, then ask me if i want to save a pdf. BUT when i do save the pdf the excel file is no longer in the folder, only the pdf shows up. Any tips on how to get it to save where i specify as a excel file then save a pdf version as well?

    Thanks for your help!
    Please Login or Register  to view this content.
    Also if there is a more efficient way to write this please let me know! Always looking to learn

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: save as pdf in current path?

    does your pdf file actually work as pdf with your code?

    saving as pdf and renaming file to .pdf is two different things...the later usually does not work in my experience
    its like renaming a .jpg in .txt and hoping it reads in text file

    also your getsaveasfilename
    Displays the standard Save As dialog box and gets a file name from the user without actually saving any files.

  7. #7
    Registered User
    Join Date
    05-14-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    78

    Re: save as pdf in current path?

    You're Correct. I learned shortly after posting it won't open

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: save as pdf in current path?

    Please Login or Register  to view this content.
    you have some variables i dont know what they are but i left them in there

    ps
    for saving pdf
    pdfilename = myFileName does nothing
    saving pdf just saves as what the workbook is saved as
    ie if workbook is 03-07-02.xlsx then pdf is 03-07-02.pdf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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