0
Dim app, fso, file, fName, wb, dir
dir = "D:\TA"
dirsave = "D:\TA\XLS"
Set app = CreateObject("Excel.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
For Each file In fso.GetFolder(dir).Files
If LCase(fso.GetExtensionName(file)) = "csv" Then
fName = fso.GetBaseName(file)
Set wb = app.Workbooks.Open(file)
app.Application.Visible = True
app.Application.DisplayAlerts = False
app.ActiveWorkbook.SaveAs dirsave & fName & ".xls", 43
app.ActiveWorkbook.Close
app.Application.DisplayAlerts = True
app.Application.Quit
End if
Next
Set fso = Nothing
Set wb = Nothing
Set app = Nothing
wScript.Quit
ich oben VB-Skript bin mit CSV-Datei zu öffnen und als xls-Datei speichern, aber es wirft FehlerFehler: SaveAs-Methode der Arbeitsmappe-Klasse ist fehlgeschlagen
Fehler: SaveAs-Methode der Arbeitsmappe-Klasse ist fehlgeschlagen.
Wie kann ich es beheben? Vielen Dank im Voraus
ist habe ich das aber es hat das Problem @Clauric nicht gelöst – nnnnmmm