dhanapal1
15 years agoContributor
How to write data into excel sheet?
Hi
Right now I am doing scripting with c# am unable to write data into excel sheet. I have tried with ole object and activex object. I have refered msdn too but I couldn't get answer. anyone please help me by providing with some examples.
Right now I am doing scripting with c# am unable to write data into excel sheet. I have tried with ole object and activex object. I have refered msdn too but I couldn't get answer. anyone please help me by providing with some examples.
function adddataexcel()
{
// Launch Excel
var app;
var book;
var sheet;
var i,j;
var val ="dpl007";
app= Sys["OleObject"]("Excel.Application");
//app = new ActiveXObject("Excel.Application");
book = app["Workbooks"]["Open"]("C:\\TestData\\dpl");
sheet = book["ActiveSheet"];
for(j=0; j<=4; j++)
sheet["Cells"](i,j).value= val; //
book["Save"]();
app["Quit"]();
}