I'm using something similar in code above this with:
$wArray[] is populated during the spin through each record returned in a query.
//Now spin through each in the array
for ($wCnt=1;$wCnt<=14;$wCnt++) {
$cell = $sheets->Cells($xRow,$yRow); //Select the cell
$cell->activate; //Activate the cell
$cell->value = $wArray[$wCnt]; //print value to cell
unset($cell);
//unset the cell var to create anew.
if ($yRow == 18) {
$yRow++;
} else {
$yRow --;
$xRow ++;
}
}
the code above works excellent. but the original code posted doesnt. I think because the $typeData array has $vars in it...whereas the $wArray array has strings of data from a query result.
I can also do individual lines/cells just fine:
$cell = $sheets->Cells(5,2) ;
$cell->activate;
$cell->value = $var1;
unset($cell);
referencing the variable directly works...but if i put all the variables in an array...there are over 20 different variables, then try to reference them in the for loop...it hangs the program.
I could do the above over 20 plus times...I just wanted to clean it up a bit with far less code by using the array and for loop.