Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  excel range is unknown

    Posted 02/05/14 10:54 AM

    Originally posted by: 2T3M_lolol


    Hi,

     

    After running the model, it has been shown that excel range is unkown......

    could you tell me why is like that? in my programming it is like that 

     

    SheetConnection sheet("check.xlsx");
    m from SheetRead(sheet,"sheet1!A1:PY441");

     

    what is wrong with it?

     

    thank you 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: excel range is unknown

    Posted 02/05/14 11:07 AM

    Originally posted by: fbahr


    The (work)sheets of check.xlsx are named 'Feuil*', not 'sheet*'.

      sheetConnection sheet("check.xlsx");
      m from SheetRead(sheet,"Feuil1!A1:PY441");

    should do the trick.

    --fbahr


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: excel range is unknown

    Posted 02/05/14 12:28 PM

    Originally posted by: 2T3M_lolol


    Oh! you are right!!!

     

    Thank you so much fbahr!!!Thank you!


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: excel range is unknown

    Posted 08/25/15 05:48 AM

    Originally posted by: CaWa


    Hi 

    I have unfortunately the same problem but I checked the names of the sheet and they should be right. Are there any other problems linked to "excel range unknown"?

     

    SheetConnection InputExcel("InputData_Worker training.xlsx");


     maxS from SheetRead(InputExcel, "BC!B2");

     

    Thank you in advance for your help!


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: excel range is unknown

    Posted 08/25/15 06:14 AM

    Hi,

    your .mod looks empty.

    The name of your excel file is InputData.xlsx

    But in your .dat you wrote

    SheetConnection InputExcel("InputData_Worker training.xlsx");

    which is different.

     

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: excel range is unknown

    Posted 08/25/15 06:25 AM

    Originally posted by: CaWa


    Sorry, I uploaded the wrong zip-folder.

    Both problems that you mentioned were already solved actually, but thanks!

    Hopefully this is the right folder now!

     

    I think there is something wrong with my Excel sheet but I really can't find the mistake.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: excel range is unknown

    Posted 08/25/15 07:06 AM

    Hi,

    you should add

    int maxS = ...;

    in your .mod

    In your .dat,

    //Parameters

     

    //wsn from SheetRead(InputExcel, "BC!B11:EU50");

     

    trs from SheetRead(InputExcel, "BC!B53:AE92");

     

    q from SheetRead(InputExcel, "BC!B95:EU169");

     

    tu from SheetRead(InputExcel, "BC!BB172:BX191");

     

    cufrom SheetRead(InputExcel, "BC!B194:U194");

     

    tt from SheetRead(InputExcel, "BC!B197:AE271");

     

    d from SheetRead(InputExcel, "BC!B274:BX274");

     

    a from SheetRead(InputExcel, "BC!B276");

    will work a little better.

    But then you get an error because you have a size discrepancy in

     

    tu from SheetRead(InputExcel, "BC!BB172:BX191");

    You should fix that: tu has to have the same dimensions as BB172:BX191

    regards

     
     

    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: excel range is unknown

    Posted 08/25/15 08:34 AM

    Originally posted by: CaWa


    Thank you for your help.

    It still tells me that there is an unknown Excel range.

    Are there any other problems connected to the SheetRead function considering that the sizes of the matrices fit?

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: excel range is unknown

    Posted 08/25/15 10:08 AM

    Hi,

    well if you comment

    //tu from SheetRead(InputExcel, "BC!BB172:BX191");

    then you still have some errors but not excel ones

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: excel range is unknown

    Posted 10/04/17 06:02 AM

    Originally posted by: Breemes


    Hi,

     

    I have the same error code and cannot find the mistake. I use tuples and for all other variables it works fine, only here is problem:

     

     

    string writeConnection5="Neu!A1:D";
    execute
    {
    writeConnection5+=Wertstoffhof.UB*Handy.UB*ExternRecycling.UB;
    }
    int value5 [w in Wertstoffhof,i in Handy, e in ExternRecycling]=w*i*e;

     

     


     tuple Tuple5
      {
     int Handy;
     int Wertstoffhof;
     int ExtRecycling;
     int value5; };
     sorted {Tuple5} ZuordnungExtRecycling = {<w,i,e, ExternesRecycling [w][i][e]>|i in Handy, w in Wertstoffhof, e in ExternRecycling} ;
     

     

    ZuordnungExtRecycling  to SheetWrite (output, writeConnection5);

     


    Can anyone assist?

    Thanks and regards,

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: excel range is unknown

    Posted 10/04/17 06:07 AM

    Just a guess:

    string writeConnection5="Neu!A1:D";

    Don't you need number after 'D'?


    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: excel range is unknown

    Posted 10/04/17 08:22 AM

    Originally posted by: Breemes


    Hi, 

     

    i found the mistake, with the following advice:

    I add  "writeln("writeConnection5 = " + writeConnection5);" to the execute part:

     

    writeConnection5+=Wertstoffhof.UB*Handy.UB*ExternRecycling.UB;
    }

      writeln("writeConnection5 = " + writeConnection5);

     

    So you get an description of the error in the Scriptingprotocol. 

    My mistake was, that the rows in Excel aren't enough -  I needed more than 1 million. 

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: excel range is unknown

    Posted 02/27/18 10:13 PM

    Originally posted by: kmvenkat


    I am trying out to connect excel sheet with prog 

    but it shows " Excel Range is unknown " 

    Code is as follows in dat file 

    SheetConnection sheet("LargeScale3LocationModel.ods");
    Warehouses from SheetRead(sheet,"City!D431:D630");  ( Error : Excel Range is unknown)
    Customers from SheetRead(sheet,"'City'!E634:GV634");
    MaxWarehousesP from SheetRead(sheet,"'City'!H212");
    distance from SheetRead(sheet,"'City'!E431:GV630");
    demand from SheetRead(sheet,"'City'!G11:G210");

     

    Not sure how to clear this error . 

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: excel range is unknown

    Posted 02/28/18 02:02 AM

    Hi,

    this should work fine.

    Do you run on windows ?

    regards


    #CPLEXOptimizers
    #DecisionOptimization