Controlling Mathematica Through the MS-DOS Command Line in VBA for CST MWS

  • Thread starter LowerySj
  • Start date
  • #1
2
0

Main Question or Discussion Point

Hi, guys. I need to control Mathematica through the MS-DOS command line in Visual Basic for Applications as part of a macro for CST Microwave Studio. I can call Mathematica through the command line just fine with

Code:
Shell("math", vbNormalFocus)
but when I try to enter commands afterward, such as

Code:
Shell ("1+1", vbNormalFocus)
then VBA interprets this as me wanting to open another command line box instead of using the one I just opened and which has the Mathematica interface up. I've searched the internet for a few hours trying to fix this with no luck, so I thought I'd ask you guys. It seems like if I just knew one or two more lines of code I could fix this. Any help would be greatly appreciated.

On a side note: the variety of VBA that CST's macro system uses is WinWrap Basic.
 

Answers and Replies

  • #2
DrClaude
Mentor
7,273
3,430
Sending commands one after the other will never work.

Generally speaking (not sure this would work with Mathematica in particular) is to generate a script file containing all the commands one wants an external program to perform, then open a shell executing the program with input from the script file.
 

Related Threads on Controlling Mathematica Through the MS-DOS Command Line in VBA for CST MWS

  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
10
Views
7K
Replies
6
Views
54K
  • Last Post
2
Replies
43
Views
21K
  • Last Post
Replies
8
Views
9K
  • Last Post
Replies
16
Views
6K
Replies
7
Views
3K
  • Last Post
Replies
5
Views
4K
  • Last Post
Replies
20
Views
75K
Replies
2
Views
2K
Top