Decision Optimization

Decision Optimization

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

 View Only
  • 1.  sheetConnection error

    Posted Thu March 24, 2016 03:55 PM

    Originally posted by: BEA123


    I have been trying to get a connection with an excel sheet.  I was able to run it a few times and then it stopped working.  The error I receive is type:  OPL Problem Marker and it tells me to contact IBM.  I know it occurs when I try to connect to the excel sheet because when I remove the code it runs fine.  Here is my .dat code.  I think the issue might be with something office is doing that prevents the connection from occurring...

    ****partial model code***

     

    range cargo=1..n;

    range comps=1..m;

    float profit[cargo]=...;

    float weight[cargo]=...;

    float volume[cargo]=...;

    float weight_cap[comps]=...;

    float space_cap[comps]=...;

     

    ***.dat code***

    SheetConnection my_sheet("Excel_Import_practice.xlsx");

    profit from SheetRead(my_sheet,"profit");

    weight from SheetRead(my_sheet, "weight");

    volume from SheetRead(my_sheet,"volume");

    weight_cap from SheetRead(my_sheet,"weight_cap");

    space_cap from SheetRead(my_sheet,"space_cap");

    x to SheetWrite(my_sheet,"results");


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: sheetConnection error

    Posted Thu March 24, 2016 04:15 PM

    Hi,

    which CPLEX version do you use ?

    Can you try to run the Oil example ? (The spreadsheet run configuration)

    Do you confirm profit, weight and so on are named ranges in excel ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: sheetConnection error

    Posted Thu March 24, 2016 08:50 PM

    Originally posted by: BEA123


    I am using community edition (64 bit) 12.6.3

    I got the same error when running the spreadsheet.  When I tried to run the one with the connection to the Microsoft access file I got this error:  Database error (state=IM002 code=0): [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, near "DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\Bryan\Desktop\Spring 2015\ISE 5454\CPLEX Code\Oil Example\Oil_Example\oilDB.mdb//".

     

    I also rechecked to ensure my ranges were named properly and they are.​

     

    Thanks for the help


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: sheetConnection error

    Posted Fri March 25, 2016 02:57 AM

    Hi,

    are you using a 32 bits excel ?

    If you are can you try to instal CPLEX 32 bits and try again ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: sheetConnection error

    Posted Thu March 31, 2016 02:16 PM

    Originally posted by: BEA123


    I installed the 32 bit version and I am still receiving the same error.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: sheetConnection error

    Posted Thu March 31, 2016 02:20 PM

    Hi,

    can you attach your model ?

    Have you tried with oplrun ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: sheetConnection error

    Posted Thu March 31, 2016 03:14 PM

    Originally posted by: BEA123


    I was able to fix the access issue by downloading  Microsoft Access database engine 2010.  So I can now run the access oil examples and my own access code.  I wonder if there is something wrong with the ODBC Driver communicating with excel.  I am not sure how to trouble shoot that...I have attached my files.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: sheetConnection error

    Posted Fri April 01, 2016 02:37 AM

    Hi,

    I ran your files in the IDE and they work fine. (I used CPLEX 12.6.3 64 bits)

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: sheetConnection error

    Posted Fri April 01, 2016 12:46 PM

    Originally posted by: BEA123


    I am sorry, but I do not know what "in the IDE" means.

    Thanks.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: sheetConnection error

    Posted Fri April 01, 2016 02:44 PM

    Hi,

    IDE means Integrated Development Environment.

    It means the studio.

    See

    http://www-01.ibm.com/software/commerce/optimization/model-development/

    regards

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer