Th problem is the character used in the file name "ø".
You need to delete/change it.
Sub test()
Dim myDir As String, fn As String, LastC As Range
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then myDir = .SelectedItems(1) & "\"
End With
If myDir = "" Then Exit Sub
Application.DisplayAlerts = False
Cells.Delete
Application.DisplayAlerts = True
fn = Dir(myDir & "*.csv")
Do While fn <> ""
If IsEmpty([a1]) Then
Set LastC = [a1]
Else
Set LastC = Cells.Find("*", , , , 2, 2)(, 2).EntireColumn.Range("a1")
End If
LastC.Value = fn
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & myDir & fn, Destination:=LastC(2))
.TextFileSemicolonDelimiter = True
.TextFileDecimalSeparator = "."
.TextFileThousandsSeparator = ","
.Refresh BackgroundQuery:=False
End With
fn = Dir
Loop
End Sub
Bookmarks