momo2016
Goto Top

Excel VBA Datei auswählen, dateipfad und dateiname ohne Format speichern, und in anderem Format speichern

Hallo,

ich bin noch relativ neu in VBA und bräuchte eure Hilfe.
Und zwar möchte ich vom Benutzer eine .csv-Datei auswählen lassen, diese als .xlsx speichern und den Dateipfad und Dateiname als Variable in VBA gespeichert haben, sodass man darüber auf die Datei zugriff hat, z.B um sie zu öffnen oder Daten austzulesen.
Ich hoffe mir kann da jmd. helfen face-smile

Viele Grüße Momo

Content-Key: 315836

Url: https://administrator.de/contentid/315836

Printed on: April 18, 2024 at 02:04 o'clock

Mitglied: 129813
Solution 129813 Sep 21, 2016 updated at 13:28:26 (UTC)
Goto Top
Sub Test
    Dim wb As Workbook, result as Variant
    result = Application.GetOpenFilename(FileFilter:="CSV-Files(*.csv),*.csv", Title:="Please choose a file")  
    If result <> False Then
        Set wb = Workbooks.Open(result)
        wb.SaveAs "C:\target.xlsx"  
    End If
End sub
Regards