Originally posted by: SystemAdmin
[dgravot@noos.fr said:]
I found some workaround to write in excel with dynamic ranges, e.g those like A1..XY, where X is a column and Y is a row whose value are parameters-dependant (for instance, X is the number of periods and Y is the number of persons that are typically dynamic inputs)
I simply define a string in my opl model . This string will represent the excel range that I 'm going to write in in excel. Then, this string is set up in a script like the following one :
string outputCommande ;
{
var col1 = String.fromCharCode(65+NbPeriods+1);//Alphabet
outputCommande = "Command!C2:"+col1+(NbAllItems+1);
}
allcommands to SheetWrite(sheet2,outputCommand);//in the dat file
Hope this helps, but it is limited to the first 26 columns and is not able to compute directly column names like AA, AB...
David Gravot
ROSTUDEL - Operations Research
57, rue d'Alleray 75015 Paris - France
(33)1 45 31 19 06 / (33) 6 13 46 07 63
dgravot@rostudel.comwww.rostudel.com #DecisionOptimization#OPLusingCPLEXOptimizer