johant1957
Programmer
Hi,
I have entered the code for showing me a directory list when I want to import an excel file. But I can only see Maps, no files. Can anybody help me so I can see and select the files I want to use?
CODE:
Sub Show_BrowseDirectory_dialog()
Dim dirInfo As BROWSEINFO
Dim path As String
Dim r As Long, X As Long, pos As Integer
dirInfo.pidlRoot = 0&
dirInfo.lpszTitle = "Selecteer een map"
dirInfo.ulFlags = &H1
X = SHBrowseForFolder(dirInfo)
path = Space$(512)
r = SHGetPathFromIDList(ByVal X, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
MsgBox ("U heeft geselecteerd := " & Left(path, pos - 1))
Else
MsgBox ("Selecteer een folder")
End If
End Sub
Kind regards
I have entered the code for showing me a directory list when I want to import an excel file. But I can only see Maps, no files. Can anybody help me so I can see and select the files I want to use?
CODE:
Sub Show_BrowseDirectory_dialog()
Dim dirInfo As BROWSEINFO
Dim path As String
Dim r As Long, X As Long, pos As Integer
dirInfo.pidlRoot = 0&
dirInfo.lpszTitle = "Selecteer een map"
dirInfo.ulFlags = &H1
X = SHBrowseForFolder(dirInfo)
path = Space$(512)
r = SHGetPathFromIDList(ByVal X, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
MsgBox ("U heeft geselecteerd := " & Left(path, pos - 1))
Else
MsgBox ("Selecteer een folder")
End If
End Sub
Kind regards