i created this code but its not running how can i fix it please:
i have a button in a vba excel and want to run the cplex code when it is pressed i dont think i have access on the oplrun.exe as i am on a university laptop
i have extra code but this is not running, i keep getting the messages box but cplex doesnt run
MsgBox "External call to OPL is starting."
Dim oplRunPath As String
oplRunPath = "C:\Program Files\IBM\ILOG\CPLEX_Studio1210\opl\bin\x64_win64\oplrun.exe"
Dim modelFilePath As String
modelFilePath = "C:\Users\s_samah\Desktop\capstone with vba\Full Time Student\FullTime.mod"
Dim dataFilePath As String
dataFilePath = "C:\Users\s_samah\Desktop\capstone with vba\Full Time Student\FullTime.dat"
Dim shellCommand As String
shellCommand = oplRunPath & " " & modelFilePath & " " & dataFilePath
Shell shellCommand
MsgBox "OPL model execution has been initiated."
------------------------------
sebastian samaha
------------------------------
Original Message:
Sent: Thu December 02, 2021 04:43 AM
From: ALEX FLEISCHER
Subject: Running CPLEX using excel vba
Hi
the example How to call OPL from Excel ? in Excel and OPL works fine
regards
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
Original Message:
Sent: Wed December 01, 2021 10:04 AM
From: Beatriz Santos
Subject: Running CPLEX using excel vba
Hi,
I have an excel file that i would like to use as an interface to running a CPLEX problem. I have tried to use the shell function on vba so that i could run my cplex model but i doesn't seem to be working. I used the following code:
Public Sub callCPLEX()
MsgBox ("External call to OPL")
Dim strPath As String
strPath = "C:\ILOG\CPLEX_Studio1210\opl\bin\x64_win64\oplrun.exe C:\Diretorio MOADE\Trabalho_v2\Trabalho_v2.mod C:\Diretorio MOADE\Trabalho_v2\Trabalho_v2.dat"
Shell strPath
End Sub
But nothing happens, as CPLEX isn't opened and the mod file isn't runned.
Thank you!
------------------------------
Beatriz Santos
------------------------------
#DecisionOptimization