Hi.
I am trying to add columns only when it doesn't exist. I am trying to use the option: worksheet -v
but when the code moves to the second sheet, it copies the data to the first one and not the current one. My code looks like this:
newbook MelaninIndex;
range Area = [MelaninIndex]Sheet1!2;
range Name = [MelaninIndex]Sheet1!1;
win -a DatosMelanina;
int jj = 1;
doc -e LW
{
string str =wks.name$;
range Reflectance = Col(2);
worksheet -v logR;
range logR1 = logR;
logR1 = -log(Reflectance);
range linex = Col(1)[5:10];
worksheet -v Line1;
range line1 = Line1;
line1 = linex;
range liney = Col(3)[5:10];
worksheet -v Line2;
range line2 = Line2;
line2 = liney;
wks.col = 4;
wks.col.type = 4;
worksheet -v XFit;
worksheet -v FitData;
fitLR iy:=(4,5) oy:=(col(XFit),col(FitData));
range Fit = FitData;
integrate Fit;
Area[jj] = integ.area/100;
Name[jj]$ = str$;
jj++;
}
I am using windows 10 and OriginPro 2016