gibt es eine möglichkeit
einen Folder name ähnlich wie hier
hier
Dim fileToOpen As String
fileToOpen = Application.GetOpenFilename("JPG Files (*.jpg), *.jpg")
der Filename ausgewählt werden kann
auszuwählen.
Gruß
Swen
Sub test()
MsgBox GetOrdner("C:\") 'Die Vorauswahl kannst du auch weglassen
End Sub
'Ordnerauswahl
Function GetOrdner(Optional ByVal def = "")
Dim objShell As Object, objfolder As Object
Set objShell = CreateObject("Shell.Application")
Set objfolder = objShell.BrowseForFolder(0, "Bitte einen Ordner wählen", 0, def)
If objfolder Is Nothing Then Exit Function
GetOrdner = objfolder.Self.Path
End Function
Sub Ordner()
Dim Path As Variant
Path = Application.GetOpenFilename("(Alle), *.*")
If Path = False Then
Exit Sub 'Abbrechen wurde geklickt
Else
Do Until Right(Path, 1) = "\"
Path = Left(Path, Len(Path) - 1)
Loop
Path = Left(Path, Len(Path) - 1)
MsgBox Path
End If
End Sub
Option Explicit
Public Sub test()
Dim datei
Dim pfad
datei = Application.GetOpenFilename
If datei <> False Then
pfad = Replace(datei, Dir(datei), "")
MsgBox pfad
End If
End Sub