+ Reply to Thread
Results 1 to 6 of 6

GetSaveAs Function

  1. #1
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    GetSaveAs Function

    I am using Application.GetSaveAsFilename to get a file name input by the user. I am trying to set both the opening folder path as well as a suggested file name using the InitialName parameter. If I specify InitialName as the full path and file name, it opens in the C:\ root directory. If I specify just the file name without the path, it opens in the same directory as the workbook file. Is there any way to set both the opening path and the file name separately?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: GetSaveAs Function

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: GetSaveAs Function

    Hi Joe,

    Instead of Application.GetSaveAsFilename why not try to use
    Please Login or Register  to view this content.
    which will open a dialog box and allow the user to select the file they want.
    Then you can parse the path and file returned name.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: GetSaveAs Function

    Hi,

    I would just add to shg's answer to say that it is safer to use ChDrive first to ensure the correct drive is current, otherwise the ChDir may not work even though it won't cause an error.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: GetSaveAs Function

    Thanks...I'll try the proposed solutions. I did not think you could change the directory in Excel VBA, only read the current directory. Also was not aware of the Application.FindFile function.

  6. #6
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: GetSaveAs Function

    The ChDrive and ChDir worked great. The Application.FindFile is only for opening files and does not return a file name.

+ 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. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  2. [SOLVED] GetSaveAs-issue - please help out a novice ;)
    By Alina1404 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-29-2012, 06:38 AM
  3. GetSaveAs issues
    By just66horns in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2008, 03:17 PM
  4. [SOLVED] Help on GetSaveas Filename
    By Utkarsh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2006, 09:50 AM
  5. New to VBA..need help with automating GETSAVEAS Macro in Excel 2003
    By xphile in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2006, 01:37 AM
  6. timeout on GetSaveAs?
    By msteiert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2005, 10:30 PM
  7. No Success with GetSaveAs
    By D.Parker in forum Excel General
    Replies: 5
    Last Post: 04-20-2005, 10:06 AM

Tags for this Thread

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