//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); //Load template file Simple invoice.xlsx from resource var fileStream = this.GetResourceStream("xlsx\\Simple invoice.xlsx"); workbook.Open(fileStream); var worksheet = workbook.ActiveSheet; // fill some new items worksheet.Range["E09:H09"].Value = new object[] { "DD1-001", "Item 3", 5.60, 12 }; worksheet.Range["E10:H10"].Value = new object[] { "DD2-001", "Item 3", 8.5, 14 }; worksheet.Range["E11:H11"].Value = new object[] { "DD3-001", "Item 3", 9.6, 16 };
' Create a new Workbook Dim workbook As New Workbook 'Load template file Simple invoice.xlsx from resource Dim fileStream = GetResourceStream("Simple invoice.xlsx") workbook.Open(fileStream) Dim worksheet = workbook.ActiveSheet ' fill some new items worksheet.Range("E09:H09").Value = New Object() {"DD1-001", "Item 3", 5.6, 12} worksheet.Range("E10:H10").Value = New Object() {"DD2-001", "Item 3", 8.5, 14} worksheet.Range("E11:H11").Value = New Object() {"DD3-001", "Item 3", 9.6, 16} ' save to an excel file workbook.Save("SimpleInvoice.xlsx")