+ Reply to Thread
Results 1 to 8 of 8

Using Excel built-in dialogs

  1. #1
    Registered User
    Join Date
    05-19-2010
    Location
    Newport Pagnell, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Using Excel built-in dialogs

    Excel Help in the "Dialog.Show Method" says you can find out what the arguments (Arg1 to Arg30) mean for each dialog by searching on the dialog box constant e.g. xlDialogOpen.

    I get no results when I search on xlDialogOpen.

    What are these arguments? Is there somewhere else I can look for their meaning?

    The Show Method returns a Boolean. What I want is the filename and path selected by teh user so that I can save it in cells in a worksheet.

    Thanks for the help.
    Last edited by SgtSunshine; 07-22-2010 at 08:27 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using Excel built-in dialogs

    Are you using the GetOpenFile dialog?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Using Excel built-in dialogs

    in vbe open the help (F1)
    search for 'Built-In Dialog Box Argument Lists'

    xlDialogOpen

    file_text, update_links, read_only, format, prot_pwd, write_res_pwd, ignore_rorec, file_origin, custom_delimit, add_logical, editable, file_access, notify_logical, converter
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    05-19-2010
    Location
    Newport Pagnell, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Using Excel built-in dialogs

    I'm using Excel 2007 (although I want my app work with 2003 also). In 2007, all the dialog constants begin with xlDialog (e.g. xlDialogOpen). I can't see one like "GetOpenFile".

    Perhaps the xlDialogFindFile dialog will do what I want, but there doesn't seem to be any help on defining what the various dialogs do or what their arguments are to the Show method.

  5. #5
    Registered User
    Join Date
    05-19-2010
    Location
    Newport Pagnell, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Using Excel built-in dialogs

    Brilliant Andy! Exactly what I wanted. I'll close the thread.

    Thanks.

  6. #6
    Registered User
    Join Date
    05-19-2010
    Location
    Newport Pagnell, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Using Excel built-in dialogs

    Hmmmm..... Actually, this doesn't quite solve the problem.

    I want to open a dialog box, allowing the user to locate a file. I don't want to open the file at this point, I just want to store the path and the filename. Actually, even better, I want the user to decide on a folder to use for data and I will decide on the filename (which gets used later in the code).

    I was hoping that the arguments to xlDialogFindFile or xlDialogOpen might help with determining how the Show method works, but that doesn't seem to be the case.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Using Excel built-in dialogs

    Then use then GetOpenFilename method which displays the file selection dialog but only returns selected file(s) if any.

  8. #8
    Registered User
    Join Date
    05-19-2010
    Location
    Newport Pagnell, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Using Excel built-in dialogs

    Great.

    And I have now found:
    Please Login or Register  to view this content.
    Allows the user to select a folder.

    Perfect.

+ 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