Wer kann mir da weiter helfen.....bin auch ziemlich neu was VBA anbelangt
Für die Version 9.0 (Office 2000) und 97
Vorab herzlichen Dank für die Hilfe
Wer kann mir da weiter helfen.....bin auch ziemlich neu was VBA anbelangt
Für die Version 9.0 (Office 2000) und 97
Vorab herzlichen Dank für die Hilfe
mfg, GraFri'_______________________________________________________________________________________
'In ein Modul
Option Explicit
Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" ( _
ByVal pidl As Long, ByVal pszPath As String) As Long
Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" ( _
lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Sub Ordner_auswählen()
Dim Result As String
Result = GetDirectory("Ordner auswählen ...")
' MsgBox Result
Sheets("Tabelle1").[A1] = Result
End Sub
Private Function GetDirectory(Msg As String) As String
Dim bInfo As BROWSEINFO
Dim path As String
Dim ret As Long
Dim pos As Integer
With bInfo
.pidlRoot = 0&
.lpszTitle = Msg
.ulFlags = &H1
End With
ret = SHBrowseForFolder(bInfo)
path = Space$(512)
ret = SHGetPathFromIDList(ByVal ret, ByVal path)
If ret Then
pos = InStr(path, Chr$(0))
GetDirectory = Left(path, pos - 1)
Else
GetDirectory = vbNullString
End If
End Function