Dim file_name As String
Dim fnum As Integer
Dim whole_file As String
Dim lines As Variant
Dim one_line As Variant
Dim num_rows As Long
Dim num_cols As Long
Dim the_array() As String
Dim R As Long
Dim C As Long
file_name = ThisWorkbook.Path
If Right$(file_name, 1) <> "\" Then file_name = _
file_name & "\"
file_name = file_name & "test.csv"
' Load the file.
fnum = FreeFile
Open file_name For Input As fnum
whole_file = Input$(LOF(fnum), #fnum)
Close fnum
' Break the file into lines.
lines = Split(whole_file, vbCrLf)
For R = 0 To num_rows
If Len(lines(R)) > 0 Then
one_line = Split(lines(R), ",")
For C = 0 To num_cols
the_array(R, C) = one_line(C)
Next C
End If
Next R
' Prove we have the data loaded.
For R = 0 To num_rows
For C = 0 To num_cols
MsgBox the_array(R, C) & "|"
Next C
Debug.Print
Next R
Debug.Print "======="
End Sub