Const sCsvFileName = "C:\Users\XXX\data.csv"
Dim objFSO
Dim objFile
Dim strLine,SpltTmp
Dim i,iDimPos,colum1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(sCsvFileName)
Do While objFile.AtEndOfStream <> True
'CSV列の最大数
Redim strRec(12)
strLine = ""
Do While objFile.AtEndOfStream <> True
strLine = strLine + objFile.ReadLine
If (Len(strLine) - Len(Replace(strLine,"""",""))) Mod 2 = 0 Then Exit Do
strLine = strLine + vbNewLine
Loop
iDimPos = 0
For Each SpltTmp In Split(strLine,",")
If iDimPos > 11 Then
Exit For
End If
If Instr(SpltTmp,"""") = 0 Then
strRec(iDimPos) = SpltTmp
iDimPos = iDimPos + 1
ElseIf Instr(SpltTmp,"""") = 1 And InStrRev(SpltTmp,"""") = Len(SpltTmp) Then
If Instr(1, SpltTmp, """") = 2 Then
strRec(iDimPos) = ""
Else
strRec(iDimPos) = Mid(SpltTmp,2,Len(SpltTmp)-2)
End If
iDimPos = iDimPos + 1
Else
strRec(iDimPos) = strRec(iDimPos) + SpltTmp
If InStrRev(SpltTmp,"""") = Len(SpltTmp) Then
strRec(iDimPos) = Mid(strRec(iDimPos),2, Len(strRec(iDimPos))-2)
iDimPos = iDimPos + 1
End If
End If
Next
'1番目の項目
colum1 = strRec(0)
'具体的な処理は省略
Loop
objFile.Close