HERBERS Excel-Forum - das Archiv
Dateipfad in Variable
chrissey

Hallo Leute,
seid gegrüßt.
Folgende Frage:
Öffne in VBA über Application.Dialogs(xlDialogOpen).Show eine .xls Datei,
jetzt hätte ich gerne den Pfad der dadurch geöffneten Datei in einer Variablen
sagen wir DatPfad.
Ist das möglich?
Bitte um Hilfe.
Danke Euch schon mal und Grüße
Chrissey

AW: Dateipfad in Variable
ptonka

Hallo Chrissey,
nach öffnen der Datei:
DatPfad = ActiveWorkbook.Path
Gruß,
Ptonka
AW: Dateipfad in Variable
chrissey

Des funktioniert leider nicht, da ja das Sheet das die Prozedur ausführt noch aktiv ist
und nicht das über die Anweisung Application.Dialogs(xlDialogOpen).Show geöffnete.
Deshalb bekomme ich nicht den Pfad der geöffneten Datei sonder die der Ausgangsdatei.
?
Grüße
AW: Dateipfad in Variable
Rudi

Nach Öffnen der Datei!!!
AW: Dateipfad in Variable
ptonka

Hallo,
bei mir klappt es so:
Sub test
Application.Dialogs(xlDialogOpen).Show
DatPfad = ActiveWorkbook.Path
MsgBox DatPfad
End Sub
Gruß,
Ptonka
AW: Dateipfad in Variable
chrissey

Genau so hatt ich es.