Sub Cursor2CSV(Cursor1 As Cursor, strFolder As String, strCSVFileName As String)
Dim i As Long
Dim c As Long
Dim lstCSV As List
Dim UB As Long
Dim UB2 As Int
UB = Cursor1.RowCount - 1
UB2 = Cursor1.ColumnCount - 1
Dim arrFields(UB2 + 1) As String
lstCSV.Initialize
Cursor1.Position = 0
For c = 0 To UB2
arrFields(c) = Cursor1.GetColumnName(c)
Next
lstCSV.Add(arrFields)
For i = 0 To UB
Dim Cols(UB2 + 1) As String 'needs to be in the loop, to add new array at every iteration
Cursor1.Position = i
For c = 0 To UB2
Cols(c) = Cursor1.GetString2(c)
If Cols(c) = Null Then 'to avoid an error at su.SaveCSV
Cols(c) = ""
End If
Next
lstCSV.Add(Cols)
Next
sUtils.SaveCSV(strFolder, strCSVFileName, ",", lstCSV)
End Sub