Function ReadCSV(ByVal filePath As String) As Variant
Dim fso As Object
Dim ts As Object
Dim content As String
Dim lines() As String
Dim lineCount As Long
Dim i As Long
' Create FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")
' Open the file with Shift-JIS encoding
Set ts = fso.OpenTextFile(filePath, 1, False, -1)
' Count the number of lines in the file
lineCount = 0
Do While Not ts.AtEndOfStream
ts.ReadLine
lineCount = lineCount + 1
Loop
' Close and reopen the file to reset the position
ts.Close
Set ts = fso.OpenTextFile(filePath, 1, False, -1)
' Read the file content line by line
ReDim lines(1 To lineCount)
For i = 1 To lineCount
lines(i) = ts.ReadLine
Next i
' Close the file
ts.Close
ReadCSV = lines
End Function