With CreateObject("Scripting.FileSystemObject")
With .getfile(ThisWorkbook.Path & "\data.csv").openastextstream
buf = .readall
.Close
End With
End With
For i = 0 To UBound(Lines)
Values = Strings.Split(RE.Replace(Lines(i), vbNullChar), vbNullChar)
For j = 0 To UBound(Values)
If Left(Values(j), 1) = """" Then
Values(j) = Mid(Values(j), 2, Len(Values(j)) - 2)
Values(j) = Replace(Values(j), """""", """")
End If
Data(i, j) = Values(j)
Next
Next
Set RE = Nothing
CsvToArray = Data
End Function
' ---