2

I have the code in Mathematica nb.file and I want to use it in my VB application via Net/Link.
Is there any way how to use the code from nb.file directly? For example like I will execute the code in Mathematica via VB?

oers
  • 18,436
  • 13
  • 66
  • 75

1 Answers1

1

One way would be to construct a string with something like the following instructions and send it to the mathkernel Compute function within .NET:

Needs["JLink`"];
$FrontEndLaunchCommand = "Mathematica.exe";
UseFrontEnd[nb = NotebookOpen["C:\\Temp\\run.nb"];
  SelectionMove[nb, Next, Cell];
  SelectionEvaluate[nb];];
Pause[10];
CloseFrontEnd[];

ref. Uncaught Throw generated by JLink or UseFrontEnd

Community
  • 1
  • 1
Chris Degnen
  • 8,443
  • 2
  • 23
  • 40