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

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Show standard File dialog box (97 sr2, XP sp1)

    Author
    Topic
    #382558

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #648976

      See if GetSaveAsFileName is what you want, here 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.

    Viewing 0 reply threads
    Reply To: Show standard File dialog box (97 sr2, XP sp1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: