Results 1 to 8 of 8

Thread: Solved: Workbook_beforesave saves file twice

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    Application.GetSaveAsFilename lets the user choose a name and location. You can preload them where you want with ChDir. If you want to be elaborate, you might perform your own edits on what you allow as to filename and locations, a la[vba]Dim sDestPath As String
    sDestPath = Application.GetSaveAsFilename(, , , Title:="Set destination dir")
    sDestPath = Left(sDestPath, InStrRev(sDestPath, "\") - 1) ' strip all following final \, so it's a dir name only[/vba]and mess with the directory name and such, maybe later going
    Application.SaveAs sDestPath & sMyFileName

    Or just[vba]sOutFileName = Application.GetSaveAsFilename(, , , Title:="Set destination file")
    Application.SaveAs sOutFileName[/vba]
    Last edited by TheAntiGates; 08-16-2011 at 04:35 PM.
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •