GetDirectory in VBA not showing everything

dee101

Active Member
Joined
Aug 21, 2004
Messages
282
When I look at devices and drives under this pc I can see local disk (c), DVD RW Drive (D), USB’s (E-H) and my phone.

In the code I do not see my phone listed there, is there anyway to make it show also.
Here is the code I am using
Excel 2003


Code:
Msg = "Select the directory. All subdirectories will be included."

Directory = GetDirectory(Msg)

If Directory = "" Then Exit Sub

If Right(Directory, 1) <> "\" Then Directory = Directory & "\"
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Does this work on your version of Excel?
1693337476618.png


I had to respond to a prompt on my iPhone to "trust" the computer that was trying to access it.

VBA Code:
Public Function DirectoryDialog() As String
  Dim directory
  Msg = "Select the directory. All subdirectories will be included."
  
  With Application.FileDialog(msoFileDialogFolderPicker)
    .Show
    'Debug.Print .SelectedItems.Count
    If .SelectedItems.Count = 0 Then Exit Function
    directory = .SelectedItems(1)
    
  End With
  If Right(directory, 1) <> "\" Then directory = directory & "\"
  DirectoryDialog = directory
End Function
 
Upvote 0

Forum statistics

Threads
1,215,135
Messages
6,123,239
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top