472,127 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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 1363
ADezii
8,830 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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.