+ Reply to Thread
Results 1 to 3 of 3

Browse Folder Dialog - show msgbox if nothing selected

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Browse Folder Dialog - show msgbox if nothing selected

    I'm having some trouble showing a messagebox if the user presses OK but doesn't select a folder using msoFileDialogFolderPicker. Can someone help point me in the right direction?

    Please Login or Register  to view this content.
    The 2 MsgBox's I've added show the same string, yet the If Not InStr line returns true regardless if ":\" is in the string or not. Any advice or other methods you can suggest?
    Last edited by VBA FTW; 05-19-2014 at 03:40 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Browse Folder Dialog - show msgbox if nothing selected

    I use a reusable function as a folder picker. You can use len on the result to see if a folder was returned or not. See below:

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Browse Folder Dialog - show msgbox if nothing selected

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. [SOLVED] Macro to import .csv from browse for file location dialog box.
    By gutterball in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2014, 08:30 AM
  2. Userform image browse folder, show preview and save to range
    By Mehmet82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2013, 12:47 PM
  3. [SOLVED] Get browse folder pop-up window to remember selected directory
    By IOwnAKangaroo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2013, 08:57 AM
  4. Different 'Browse for Folder' dialog?
    By Jon.R in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2011, 02:30 PM
  5. Excel 2010 64-bit Browse for folder Dialog box
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2010, 02:27 PM

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