+ Reply to Thread
Results 1 to 6 of 6

[SOLVED] Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

  1. #1
    Paul Martin
    Guest

    [SOLVED] Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    Hi all

    GetOpenFilename and Dialogs(xlDialogsOpen) seem almost identical, with
    the latter having an advantage of not having to filter for XL files,
    but the former having slightly more flexility. Generally I've been
    using GetOpenFilename, but it seems that Dialogs(xlDialogsOpen) is more
    efficient (code-wise). Can anyone shed any further light as to which
    is the better to use?

    Thanks in advance

    Paul Martin
    Melbourne, Australia


  2. #2
    Rob Bovey
    Guest

    Re: Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    "Paul Martin" <[email protected]> wrote in message
    news:[email protected]...
    > GetOpenFilename and Dialogs(xlDialogsOpen) seem almost identical, with
    > the latter having an advantage of not having to filter for XL files,
    > but the former having slightly more flexility. Generally I've been
    > using GetOpenFilename, but it seems that Dialogs(xlDialogsOpen) is more
    > efficient (code-wise). Can anyone shed any further light as to which
    > is the better to use?


    Hi Paul,

    Which one is better all depends on what you're trying to do. But I would
    hazard a guess that most developers most of the time want to have complete
    control over the process of opening a workbook from their applications. You
    get This with Application.GetOpenFilename, because all it does is return the
    full path and filename selected by the user as a string. The rest is up to
    you. With Application.Dialogs(xlDialogsOpen) Excel attempts to open the file
    selected by the user unconditionally.

    --
    Rob Bovey, Excel MVP
    Application Professionals
    http://www.appspro.com/

    * Take your Excel development skills to the next level.
    * Professional Excel Development
    http://www.appspro.com/Books/Books.htm



  3. #3
    Paul Martin
    Guest

    Re: Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    Hi Rob

    Thanks for your prompt response.

    BTW, I recently purchased two of your books - I'm especially impressed
    by your Professional Excel Development. Great stuff!

    Regards

    Paul


  4. #4
    Bob Phillips
    Guest

    Re: Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    Also, the Dialogs option only works with Excel 2002 on, not earlier
    versions.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Rob Bovey" <[email protected]> wrote in message
    news:[email protected]...
    > "Paul Martin" <[email protected]> wrote in message
    > news:[email protected]...
    > > GetOpenFilename and Dialogs(xlDialogsOpen) seem almost identical, with
    > > the latter having an advantage of not having to filter for XL files,
    > > but the former having slightly more flexility. Generally I've been
    > > using GetOpenFilename, but it seems that Dialogs(xlDialogsOpen) is more
    > > efficient (code-wise). Can anyone shed any further light as to which
    > > is the better to use?

    >
    > Hi Paul,
    >
    > Which one is better all depends on what you're trying to do. But I

    would
    > hazard a guess that most developers most of the time want to have complete
    > control over the process of opening a workbook from their applications.

    You
    > get This with Application.GetOpenFilename, because all it does is return

    the
    > full path and filename selected by the user as a string. The rest is up to
    > you. With Application.Dialogs(xlDialogsOpen) Excel attempts to open the

    file
    > selected by the user unconditionally.
    >
    > --
    > Rob Bovey, Excel MVP
    > Application Professionals
    > http://www.appspro.com/
    >
    > * Take your Excel development skills to the next level.
    > * Professional Excel Development
    > http://www.appspro.com/Books/Books.htm
    >
    >




  5. #5
    Rob Bovey
    Guest

    Re: Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Also, the Dialogs option only works with Excel 2002 on, not earlier
    > versions.


    Hi Bob,

    The Application.Dialogs collection has been around since Excel 97. Or
    were you talking about something different?

    --
    Rob Bovey, Excel MVP
    Application Professionals
    http://www.appspro.com/

    * Take your Excel development skills to the next level.
    * Professional Excel Development
    http://www.appspro.com/Books/Books.htm



  6. #6
    Bob Phillips
    Guest

    Re: Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)

    Hi Rob,

    You are absolutely correct. I wasn't thinking that Application.Dialogs was
    new, but thinking that the xlDialogOpen option was.

    On re-checking it, I can see I was thinking of the File Browser dialog,
    Application.FileDialog. Ah well ...

    Regards

    Bob


    "Rob Bovey" <[email protected]> wrote in message
    news:[email protected]...
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Also, the Dialogs option only works with Excel 2002 on, not earlier
    > > versions.

    >
    > Hi Bob,
    >
    > The Application.Dialogs collection has been around since Excel 97. Or
    > were you talking about something different?
    >
    > --
    > Rob Bovey, Excel MVP
    > Application Professionals
    > http://www.appspro.com/
    >
    > * Take your Excel development skills to the next level.
    > * Professional Excel Development
    > http://www.appspro.com/Books/Books.htm
    >
    >




+ 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