Read and write data to Excel using javascript..!
Hi Everyone!
I have one excel document named as Temp.xls which is contains filename and file path.
Now I need check that Excel file name with active document name, If match found we need to update the current path of active document to existing file path location.
Please suggest me if any other solution much appreciated.
yajiv
My code is :
UpdateExcel();
function UpdateExcel(){
var docRef=app.activeDocument;
var docPath=docRef.path;
var dname=docRef.name;
var f = docPath+"/Temp.xls";
var datafile = new File(f);
if (datafile.exists) {
datafile.open('a') ;
while (datafile.eof){
strLineIn = datafile.readln();
colorArray = strLineIn.split(",");
if (colorArray[1]!=""){
if(colorArray[1].match(dname)!=null){
colorArray[2]=docPath;
}
}
}
}
}
