469,091 Members | 1,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,091 developers. It's quick & easy.

How can I write a command to browse the file folder in Module?

10
Hi

How can I write a command to browse the file folder in Module?

Thank you in advance
Jan 7 '11 #1
1 1279
ADezii
8,800 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. 'Must 1st set a Reference to the Microsoft Office XX.X Object Library
  2. Dim dlgOpen As FileDialog
  3. Dim vrtSelectedItem As Variant
  4.  
  5. Set dlgOpen = Application.FileDialog(msoFileDialogFolderPicker)
  6.  
  7. With dlgOpen
  8.   .ButtonName = "Open Folder"
  9.   .Title = "Browse Folder Utility"
  10.   .InitialView = msoFileDialogViewLargeIcons
  11.     If .Show = -1 Then
  12.       MsgBox "Selected Folder's Path: " & .SelectedItems(1)
  13.     End If
  14. End With
  15.  
  16. 'Set the object variable to Nothing.
  17. Set dlgOpen = Nothing
Jan 8 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Mike John | last post: by
3 posts views Thread by VB Joshua | last post: by
2 posts views Thread by samvb | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.