Dim excel As Excel.Application = New Excel.Application
excel.DisplayAlerts = True
excel.Workbooks.Add(True)
'excel.Visible = True
Dim i As Integer
excel.Cells(8, 1) = "brand_key"
excel.Cells(8, 2) = "Season_Key"
excel.Cells(8, 3) = "article_key"
excel.Cells(8, 4) = "color_key"
excel.Cells(8, 5) = "inseam_key"
For i = 0 To ds.Tables(0).Rows.Count - 1
excel.Cells(i + 9, 1) = ds.Tables(0).Rows(i)("brand_key").ToString().Trim()
excel.Cells(i + 9, 2) = ds.Tables(0).Rows(i)("Season_Key").ToString().Trim()
excel.Cells(i + 9, 3) = ds.Tables(0).Rows(i)("article_key").ToString().Trim()
excel.Cells(i + 9, 4) = ds.Tables(0).Rows(i)("color_key").ToString().Trim()
excel.Cells(i + 9, 5) = ds.Tables(0).Rows(i)("inseam_key").ToString().Trim()
excel.Cells(i + 9, 6) = ds.Tables(0).Rows(i)("size_Key").ToString().Trim()
Next