+ Reply to Thread
Results 1 to 6 of 6

Saving a workbook... this should be SO easy

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    Bucks, UK
    Posts
    10

    Saving a workbook... this should be SO easy

    Damn! Just realised I'm still in the Access forum, not the Excel forum. I wish I knew how to move it!!!




    I do hope so, and that some kind person will help me out here.

    I've got a VBA sub-routine that gathers up a number of worksheets in the current workbook, opens a new workbook and chucks those worksheets into it, and I'm happy up to this point... so I now have an open workbook (called book1 by Excel until told otherwise) I want to save this new workbook under a filename made up of the contents of two cells in the original workbook and then pop up a SaveAs browse window with that new filename appearing as the filename allowing me to browse to where I'd like to place this nice newly named workbook.

    Now I have this:

    sNewfilenameFirst = Worksheets("LinkOut").Range("B1")
    sNewfilenameSecond = Worksheets("LinkOut").Range("B3")
    .
    .
    .
    .

    sNewWorkbook = Application.DefaultFilePath & "\" & sNewfilenameFirst & "-" & sNewfilenameSecond & ".xls"
    ThisWorkbook.SaveCopyAs Filename:=sNewWorkbook

    But I've decidied I don't want to use the default pathname now, I'd like to leave that decision to the user. My problem is, I don't know how to bring up a browse window with the filename filled in LOL.


    Help

    Thanks
    Last edited by V8burble; 10-28-2009 at 02:26 PM.

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Saving a workbook... this should be SO easy

    Hi,

    With a simple message box : MsgBox ...

    HTH

  3. #3
    Registered User
    Join Date
    11-18-2008
    Location
    Bucks, UK
    Posts
    10

    Re: Saving a workbook... this should be SO easy

    But that wouldn't allow me to browse to the required pathname, only to enter it... and I might not actually know it, hence the need to browse to it

  4. #4
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Saving a workbook... this should be SO easy

    You would then need an Activex control such as a Folder Browser Control ...

  5. #5
    Registered User
    Join Date
    11-18-2008
    Location
    Bucks, UK
    Posts
    10

    Re: Saving a workbook... this should be SO easy

    Oh dear... that sounds WAY over my head LOL.

  6. #6
    Registered User
    Join Date
    11-18-2008
    Location
    Bucks, UK
    Posts
    10

    Re: Saving a workbook... this should be SO easy

    Ok, think I've got it!

    MS Office help is only useful if you know exactly what you are looking for isn't it... anyway looks like the 'GetSaveAsFilename' method is what I need, it has an initial filename property which is just the ticket. Will have a try after lunch.


    EDIT:
    Yep that worked a treat.... case closed LOL.
    Last edited by V8burble; 10-28-2009 at 02:25 PM.

+ 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