//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); object[,] data = new object[,]{ {"Name", "City", "Birthday", "Sex", "Weight", "Height"}, {"Bob", "NewYork", new DateTime(1968, 6, 8), "male", 80, 180}, {"Betty", "NewYork", new DateTime(1972, 7, 3), "female", 72, 168}, {"Gary", "NewYork", new DateTime(1964, 3, 2), "male", 71, 179}, {"Hunk", "Washington", new DateTime(1972, 8, 8), "male", 80, 171}, {"Cherry", "Washington", new DateTime(1986, 2, 2), "female", 58, 161}, { "Eva", "Washington", new DateTime(1993, 2, 5), "female", 71, 180} }; //Set data. IWorksheet sheet = workbook.Worksheets[0]; sheet.Range["A1:F7"].Value = data;
' Create a new Workbook Dim workbook As New Workbook Dim data As Object(,) = { {"Name", "City", "Birthday", "Sex", "Weight", "Height"}, {"Bob", "NewYork", #6/8/1968#, "male", 80, 180}, {"Betty", "NewYork", #7/3/1972#, "female", 72, 168}, {"Gary", "NewYork", #3/2/1964#, "male", 71, 179}, {"Hunk", "Washington", #8/8/1972#, "male", 80, 171}, {"Cherry", "Washington", #2/2/1986#, "female", 58, 161}, {"Eva", "Washington", #2/5/1993#, "female", 71, 180} } 'Set data. Dim sheet As IWorksheet = workbook.Worksheets(0) sheet.Range("A1:F7").Value = data ' save to a csv file workbook.Save("SaveWorkbookToCsvFile.csv")