Inserting data into Excel Sheet with
OLEDB[
^] is provided for tables, arrays.
If you want to add some values into particular cells, for example: A1, C5, E9, you need to:
1) Create instance of Excel,
'late binding
xlApp = CreateObject("Excel.Application")
2) Open workbook,
xlWbk = xlApp.Workbooks.Open("FullFileName")
3) Add data into particular cells:
xlWsh = xlWbk.Worksheets("Sheet1")
xlWsh.Range("A1") = "String Value"
xlWsh.Range("C5") = 2005
xlWsh.Range("E9") = "Client No. 203584"
Above code is in VB.NET. Examples in C#:
http://www.c-sharpcorner.com/uploadfile/ae35ca/read-and-write-excel-data-using-C-Sharp/[
^]
http://csharp.net-informations.com/excel/csharp-excel-tutorial.htm[
^]
on CP KB:
Write Data to Excel using C#[
^]
Excel Reader[
^]