I am trying to call Matlab in my VB.Net program using COM, but it keeps opening the Matlab command window and then exiting with the run time error: object variable or With block variable not set
I am using VS 2005 on Windows 7 and have Matlab version 7.9. I also tried using a VB.Net macro in excel and it returned to same error. The getObject(,"Matlab.Application") command also returns a cannot create activex object run time error, despite Matlab being open.
Here is the relevant code:
(referenced the matlab automation type library)
Dim Matlab As Object
Dim Result As String
Matlab = CreateObject("Matlab.Application")
Result = Matlab.Execute("a = [1 2 3 4; 5 6 7 8]")
Any suggestions or tips?
I am using VS 2005 on Windows 7 and have Matlab version 7.9. I also tried using a VB.Net macro in excel and it returned to same error. The getObject(,"Matlab.Application") command also returns a cannot create activex object run time error, despite Matlab being open.
Here is the relevant code:
(referenced the matlab automation type library)
Dim Matlab As Object
Dim Result As String
Matlab = CreateObject("Matlab.Application")
Result = Matlab.Execute("a = [1 2 3 4; 5 6 7 8]")
Any suggestions or tips?