Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show standard File dialog box (97 sr2, XP sp1)

    I would like to show the user a "File Open" and "File Save" dialog. When the user saves a document, I would like to save the full path to a profile. Then, next time the user wants to open, I will present the last saved as a default. I only want this functionality for one particular XL application and therefore I will provide the open and save buttons. I am not replacing built in menu functionality.

    dlgAnswer = Application.Dialogs(xlDialogOpen).Show will show the dialogs I wish, but I cannot figure out how to return the selected file path and name to my code. I can reference an API to show a window's common dialog, which will return the full path, but then I need to distribute a DLL.

    Is there something I have missed.

    Thanks.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Show standard File dialog box (97 sr2, XP sp1)

    See if GetSaveAsFileName is what you want, <!post=here,209253>here<!/post> is a related thread. As Sammy pointed out and I had forgotten, all GetSaveAsFileName does is get the name, it doesn't do anything with the file; you need additional code to save the file, etc. Then, after the save, you can use "ThisWorkbook.FullName" to get the full path and filename for your requirements. You'll also want to consider trapping the Workbook_BeforeClose event.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show standard File dialog box (97 sr2, XP sp1)

    That is it! Thanks.

Posting Permissions

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