+ Reply to Thread
Results 1 to 5 of 5

Save file in present location

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

    Save file in present location

    The code below works fine, except it saves the file in the "Documents" folder instead of the present location. How can I get it to save in the present location? The Desktop, for example.


    Private Sub cmbComplete_Click()

    usfFinished.Hide

    Dim dt As String, wbNam As String
    wbNam = "EmpSatSur"
    dt = Format(CStr(Now), "yyyymmddhhmmss")
    ActiveWorkbook.SaveAs Filename:=wbNam & dt
    ActiveWorkbook.Close

    End Sub

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Save file in present location

    You need to specify the path - the path to my desktop is shown below with the backslash added at the end:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    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,621

    Re: Save file in present location

    Please Login or Register  to view this content.

    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


  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Save file in present location

    Hi scrabtree,

    Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  5. #5
    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,621

    Re: Save file in present location

    Ditto ... Thanks for the rep.

+ 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. Save Backup File to Different Location On Save and Exit
    By slindfors in forum Excel General
    Replies: 0
    Last Post: 06-16-2015, 09:01 AM
  2. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  3. Copy, edit and save workbook to same location as source data file, not macro file.
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 09:01 AM
  4. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  5. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  6. Replies: 1
    Last Post: 10-01-2012, 11:46 PM
  7. [SOLVED] Save file automatically with present date and time.
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2012, 03:11 AM

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