0

I have a mathcad program with thousands of variables. Is there a way I can use Python or Visual Basic to loop over all the varibles in my mathcad program and then assign them and there values to an excel spreadsheet?

A python method is preferred as I have never used VB.

Community
  • 1
  • 1
Jstuff
  • 1,266
  • 2
  • 16
  • 27

2 Answers2

1

Firstly, you can get value from a mathcad worksheet through mathcad Automation API(getValue method of Worksheet object, details can refer to the Developer Reference in the installation folder).

Secondly, you can assign the value you just get to the excel worksheet using xlwt package of python.

Robert
  • 31
  • 7
0

I have no idea what mathcad is, but in Excel, if you click on Data, you will see that you can import From Text file, and From Other Sources. Do any of those make sense? Try one and see how you get along.

Also, if you want to automate the process, turn on the Macro Recorder and then click through all the necessary steps. Your Macro will be created and saved, so you can automatically repeat the process whenever you want.

ASH
  • 20,759
  • 19
  • 87
  • 200