'Clears the previous Table1 and loads the CSV file to the Table1
Sub LoadTableFromCSV1(Dir As String, Filename As String, HeadersExist As Boolean)
ClearAll1
Dim List1 As List
Dim h() As String
If HeadersExist Then
Dim headers As List
List1 = StringUtils1.LoadCSV2(Dir, Filename, ",", headers)
Dim h(headers.Size) As String
For i = 0 To headers.Size - 1
h(i) = headers.Get(i)
Next
Else
List1 = StringUtils1.LoadCSV(Dir, FileName, ",")
Dim firstRow() As String
firstRow = List1.Get(0)
Dim h(firstRow.Length)
For i = 0 To firstRow.Length - 1
h(i) = "Col" & (i + 1)
Next
End If
NumberOfColumns1 = h.Length
ColumnWidth1 = SV1.Width / NumberOfColumns1 'update the columns widths
ColumnWidth1_1 = ColumnWidth1-ColLineWidth
SetHeader1(h)
For i = 0 To List1.Size - 1
Dim row() As String
row = List1.Get(i)
'Adding checks for filter on csv file being imported at this point
AddRow1(row)
Next
End Sub