For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C // Instantiate a Workbook object intrusive_ptr workbook =Factory::CreateIWorkbook(); // Obtaining the reference of the default(first) worksheet intrusive_ptr worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0); // Obtaining Worksheet's cells collection intrusive_ptr cells = worksheet->GetICells(); // Setting the value to the cells cells->GetObjectByIndex(new String("A1"))->PutValue("Employee"); cells->GetObjectByIndex(new String("B1"))->PutValue("Quarter"); cells->GetObjectByIndex(new String("C1"))->PutValue("Product"); cells->GetObjectByIndex(new String("D1"))->PutValue("Continent"); cells->GetObjectByIndex(new String("E1"))->PutValue("Country"); cells->GetObjectByIndex(new String("F1"))->PutValue("Sale"); cells->GetObjectByIndex(new String("A2"))->PutValue("David"); cells->GetObjectByIndex(new String("A3"))->PutValue("David"); cells->GetObjectByIndex(new String("A4"))->PutValue("David"); cells->GetObjectByIndex(new String("A5"))->PutValue("David"); cells->GetObjectByIndex(new String("A6"))->PutValue("James"); cells->GetObjectByIndex(new String("A7"))->PutValue("James"); cells->GetObjectByIndex(new String("A8"))->PutValue("James"); cells->GetObjectByIndex(new String("A9"))->PutValue("James"); cells->GetObjectByIndex(new String("A10"))->PutValue("James"); cells->GetObjectByIndex(new String("A11"))->PutValue("Miya"); cells->GetObjectByIndex(new String("A12"))->PutValue("Miya"); cells->GetObjectByIndex(new String("A13"))->PutValue("Miya"); cells->GetObjectByIndex(new String("A14"))->PutValue("Miya"); cells->GetObjectByIndex(new String("A15"))->PutValue("Miya"); cells->GetObjectByIndex(new String("B2"))->PutValue(1); cells->GetObjectByIndex(new String("B3"))->PutValue(2); cells->GetObjectByIndex(new String("B4"))->PutValue(3); cells->GetObjectByIndex(new String("B5"))->PutValue(4); cells->GetObjectByIndex(new String("B6"))->PutValue(1); cells->GetObjectByIndex(new String("B7"))->PutValue(2); cells->GetObjectByIndex(new String("B8"))->PutValue(3); cells->GetObjectByIndex(new String("B9"))->PutValue(4); cells->GetObjectByIndex(new String("B10"))->PutValue(4); cells->GetObjectByIndex(new String("B11"))->PutValue(1); cells->GetObjectByIndex(new String("B12"))->PutValue(1); cells->GetObjectByIndex(new String("B13"))->PutValue(2); cells->GetObjectByIndex(new String("B14"))->PutValue(2); cells->GetObjectByIndex(new String("B15"))->PutValue(2); cells->GetObjectByIndex(new String("C2"))->PutValue("Maxilaku"); cells->GetObjectByIndex(new String("C3"))->PutValue("Maxilaku"); cells->GetObjectByIndex(new String("C4"))->PutValue("Chai"); cells->GetObjectByIndex(new String("C5"))->PutValue("Maxilaku"); cells->GetObjectByIndex(new String("C6"))->PutValue("Chang"); cells->GetObjectByIndex(new String("C7"))->PutValue("Chang"); cells->GetObjectByIndex(new String("C8"))->PutValue("Chang"); cells->GetObjectByIndex(new String("C9"))->PutValue("Chang"); cells->GetObjectByIndex(new String("C10"))->PutValue("Chang"); cells->GetObjectByIndex(new String("C11"))->PutValue("Geitost"); cells->GetObjectByIndex(new String("C12"))->PutValue("Chai"); cells->GetObjectByIndex(new String("C13"))->PutValue("Geitost"); cells->GetObjectByIndex(new String("C14"))->PutValue("Geitost"); cells->GetObjectByIndex(new String("C15"))->PutValue("Geitost"); cells->GetObjectByIndex(new String("D2"))->PutValue("Asia"); cells->GetObjectByIndex(new String("D3"))->PutValue("Asia"); cells->GetObjectByIndex(new String("D4"))->PutValue("Asia"); cells->GetObjectByIndex(new String("D5"))->PutValue("Asia"); cells->GetObjectByIndex(new String("D6"))->PutValue("Europe"); cells->GetObjectByIndex(new String("D7"))->PutValue("Europe"); cells->GetObjectByIndex(new String("D8"))->PutValue("Europe"); cells->GetObjectByIndex(new String("D9"))->PutValue("Europe"); cells->GetObjectByIndex(new String("D10"))->PutValue("Europe"); cells->GetObjectByIndex(new String("D11"))->PutValue("America"); cells->GetObjectByIndex(new String("D12"))->PutValue("America"); cells->GetObjectByIndex(new String("D13"))->PutValue("America"); cells->GetObjectByIndex(new String("D14"))->PutValue("America"); cells->GetObjectByIndex(new String("D15"))->PutValue("America"); cells->GetObjectByIndex(new String("E2"))->PutValue("China"); cells->GetObjectByIndex(new String("E3"))->PutValue("India"); cells->GetObjectByIndex(new String("E4"))->PutValue("Korea"); cells->GetObjectByIndex(new String("E5"))->PutValue("India"); cells->GetObjectByIndex(new String("E6"))->PutValue("France"); cells->GetObjectByIndex(new String("E7"))->PutValue("France"); cells->GetObjectByIndex(new String("E8"))->PutValue("Germany"); cells->GetObjectByIndex(new String("E9"))->PutValue("Italy"); cells->GetObjectByIndex(new String("E10"))->PutValue("France"); cells->GetObjectByIndex(new String("E11"))->PutValue("U.S."); cells->GetObjectByIndex(new String("E12"))->PutValue("U.S."); cells->GetObjectByIndex(new String("E13"))->PutValue("Brazil"); cells->GetObjectByIndex(new String("E14"))->PutValue("U.S."); cells->GetObjectByIndex(new String("E15"))->PutValue("U.S."); cells->GetObjectByIndex(new String("F2"))->PutValue(2000); cells->GetObjectByIndex(new String("F3"))->PutValue(500); cells->GetObjectByIndex(new String("F4"))->PutValue(1200); cells->GetObjectByIndex(new String("F5"))->PutValue(1500); cells->GetObjectByIndex(new String("F6"))->PutValue(500); cells->GetObjectByIndex(new String("F7"))->PutValue(1500); cells->GetObjectByIndex(new String("F8"))->PutValue(800); cells->GetObjectByIndex(new String("F9"))->PutValue(900); cells->GetObjectByIndex(new String("F10"))->PutValue(500); cells->GetObjectByIndex(new String("F11"))->PutValue(1600); cells->GetObjectByIndex(new String("F12"))->PutValue(600); cells->GetObjectByIndex(new String("F13"))->PutValue(2000); cells->GetObjectByIndex(new String("F14"))->PutValue(500); cells->GetObjectByIndex(new String("F15"))->PutValue(900); // Adding a new List Object to the worksheet worksheet->GetIListObjects()->Add(new String("A1"), new String("F15"), true); intrusive_ptr listObject = worksheet->GetIListObjects()->GetObjectByIndex(0); // Adding Default Style to the table listObject->SetTableStyleType(TableStyleType_TableStyleMedium10); // Show Total listObject->SetShowTotals(true); // Saving the Excel file workbook->Save(dataDir_Tables->StringAppend(new String("FormatTable_out.xlsx")));