+ Reply to Thread
Results 1 to 3 of 3

Save to specific location

  1. #1
    Registered User
    Join Date
    07-23-2004
    MS-Off Ver
    2007
    Posts
    94

    Save to specific location

    Hello - Im having trouble with a save macro... When a user presses the button i want the file to save itself to a a specific location. The below is my caode which works apart from it saves to H:\ATMT instead of G:\2005\ATMT. Can anyone see where im going wrong?

    Thanks

    Private Sub CommandButton6_Click()
    Sheets("Report").Copy
    v2 = Sheets("Report").Range("C10").Value
    v3 = Sheets("Report").Range("N10").Value
    ChDir "G:\2005\ATMT"
    ActiveWorkbook.SaveAs Filename:= _
    v2 & " " & v3, FileFormat:=xlNormal
    End Sub

  2. #2
    FSt1
    Guest

    RE: Save to specific location

    hi,
    add the file path to the save.
    i assume v2 and v3 are cells and it's being saved as an xl file.

    ActiveWorkbook.SaveAs Filename:= _
    "G:\2005\ATMT\" & v2 & "_" & v3 & ".xls", FileFormat:=xlNormal _
    Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False

    Regards
    FSt1
    "LB79" wrote:

    >
    > Hello - Im having trouble with a save macro... When a user presses the
    > button i want the file to save itself to a a specific location. The
    > below is my caode which works apart from it saves to H:\ATMT instead
    > of G:\2005\ATMT. Can anyone see where im going wrong?
    >
    > Thanks
    >
    > Private Sub CommandButton6_Click()
    > Sheets("Report").Copy
    > v2 = Sheets("Report").Range("C10").Value
    > v3 = Sheets("Report").Range("N10").Value
    > ChDir "G:\2005\ATMT"
    > ActiveWorkbook.SaveAs Filename:= _
    > v2 & " " & v3, FileFormat:=xlNormal
    > End Sub
    >
    >
    > --
    > LB79
    > ------------------------------------------------------------------------
    > LB79's Profile: http://www.excelforum.com/member.php...o&userid=12156
    > View this thread: http://www.excelforum.com/showthread...hreadid=398632
    >
    >


  3. #3
    Registered User
    Join Date
    07-23-2004
    MS-Off Ver
    2007
    Posts
    94
    Fantastic - thats great - thanks!

+ 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