update Generic Master bas2

This commit is contained in:
updsv7
2026-04-14 21:05:39 +09:00
parent a236b92a65
commit 41ac5eb9ef
8 changed files with 557 additions and 176 deletions

View File

@@ -62,6 +62,12 @@ Function ReadCSVAs2DArrayStrict( _
Err.Raise 5003, , "CSV file is empty."
End If
If lines.Count = 1 Then
If hasHeader Then
Err.Raise 5005, , "CSV file data is empty."
End If
End If
' === loop the row, validate column count ===
Dim i As Long
For i = 1 To lines.Count
@@ -76,9 +82,16 @@ Function ReadCSVAs2DArrayStrict( _
Next i
Dim result As Variant
ReDim result(1 To lines.Count, 1 To expectedColumnCount)
For i = 1 To lines.Count
Dim startRow As Long
If hasHeader Then
startRow = 2
Else
startRow = 1
End If
ReDim result(startRow To lines.Count, 1 To expectedColumnCount)
For i = startRow To lines.Count
rowArr = lines(i)
Dim j As Long
For j = LBound(rowArr) To UBound(rowArr)