+ Reply to Thread
Results 1 to 3 of 3

vba code to browse a folder

  1. #1
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    vba code to browse a folder

    Hi All,

    I am working on macro where in, i need to browse for a folder by clicking on browse button.

    here is the code that i am using for it

    Please Login or Register  to view this content.
    Now when the file dialog opens to select a folder, if i click on Cancel button, the code crashes at "sItem = .SelectedItems(1)" how to fix this issue?

    Please help.

    Thank you.

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

    Re: vba code to browse a folder

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

  3. #3
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: vba code to browse a folder

    Thanks Norie.. It worked fine but after clicking on cancel it again pops up the file dialog and need to click on cancel one more time to close the window.

+ 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. Copy Folder Using Browse
    By davehunter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2007, 12:41 PM
  2. Browse folder in Excel X
    By kamz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2007, 03:51 PM
  3. Browse for folder
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2005, 12:55 PM
  4. browse to find folder
    By bhofsetz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2005, 01:58 PM
  5. Hard Code Folder Path for Browse Box
    By adamkozyra in forum Excel General
    Replies: 1
    Last Post: 02-01-2005, 10:41 AM

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