Forum Discussion
Azeddin_Margani
12 years agoContributor
Hi,
I'm trying to write to excel sheet using the following code but error keeps complaining about the file "C:\TestData\db1" couldn't be found. Althought i've created the file in C:\.
I'm trying to write to excel sheet using the following code but error keeps complaining about the file "C:\TestData\db1" couldn't be found. Althought i've created the file in C:\.
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\\dp1");
sheet = book["ActiveSheet"];
for(j=0; j<=4; j++)
sheet["Cells"](i,j).value= val;
book["Save"]();
app["Quit"]();
}