+ Reply to Thread
Results 1 to 6 of 6

Save file to Desktop

  1. #1
    Forum Contributor
    Join Date
    07-27-2012
    Location
    Somerset, Kentucky
    MS-Off Ver
    Excel 2007
    Posts
    123

    Save file to Desktop

    I have this code
    Please Login or Register  to view this content.
    This works great, but it saves the .PDF to the location of the master file. How can I get it to save to my Desktop, for example?

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save file to Desktop

    If it is only used by you, you can specify the path, if it is to work with any users desktop then it will have to be slightly more complex. For YOUR desktop:
    replace ActiveWorkbook.Path with "c:\users\yourusername\desktop" where you replace the word yourusername with your actual username
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save file to Desktop

    Actually... a better way would probably be to dim a variable as string... call it myDesk or something... and then :
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-01-2012
    Location
    Cairo, Egypt
    MS-Off Ver
    MS Office 2013
    Posts
    76

    Re: Save file to Desktop

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Save file to Desktop

    I think that this is what Arkadi means for any and all computers.
    Change the name "Test Report.pdf" to your filename.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save file to Desktop

    yeah jolivanes, I had forgotten about the scripting shell option and was thinking about environment variables, but just after my first post remembered the easy route

+ 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] Need dynamic file path to save on desktop regardless of user
    By reagan.kha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2015, 04:13 PM
  2. How to save as file on desktop with macro
    By slearner1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 11:35 AM
  3. [SOLVED] save as CSV file on desktop but in a 'New folder'
    By mike02 in forum Excel General
    Replies: 6
    Last Post: 08-15-2012, 05:25 PM
  4. Save text file to desktop with different name
    By VBisgreat in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-15-2012, 02:43 PM
  5. Save workbook to Desktop if file doesn't exists
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2009, 01:22 PM
  6. vba to open and save file on desktop
    By Anil2007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2009, 08:07 AM
  7. Copy Database File And Save to Desktop
    By pr4t3ek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2008, 11:03 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