Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer data from MathCad to Ms Excel 1

Status
Not open for further replies.

manurico

New member
Jul 2, 2007
6
Hello,
Im a aerospace engineer (stress), does anyone know what's the best way to transfer data from Excel to Mathcad. I have this problem: I've got a method in a mathacad file that runs one case entering some data manually into the sheet. But I have to run 200 cases so I am thinking about design a macro VBA from excel that opens my mathcad method, enters the inputs (from excel) and obtans the outputs (to excel) afterwards in just one click. Any ideas about the code to use in the macro to I/O operations. I learnt FORTRAN at school so, no much Objcts Oriented Programming idea.
Thank you.
manurico
 
Replies continue below

Recommended for you

There should be an add-in for Excel that allows you to embed a Mathcad worksheet inside your Excel. You can then reference ranges in Excel for processing in Mathcad and get answers back.

TTFN

FAQ731-376
 
Thanks IRstuff for your response, I have tried that already and seems to work "almost" fine as I get some wierd errors. The problem is that, lets say that usually mathcad is NOT a very stable program and it becomes even less stable if you get it embeded into a excel file. What about doing it completely externaly from excel??
Thanks anyway for your help.
Manuel
 
There's no reason you can't do that.

TTFN

FAQ731-376
 
At the moment I am only able to open the program MathCad externaly from a VBA macro in excel, but I don't know how to do for MathCad to open a concrete file (the one that contains the method I want to export/import data from/to excel ). Any idea about the VAB code, or any good tutorial?
Thanks
 
In Mathcad, have you tried Insert - Data - File Import (or Data Import Wizard) and select Excel, secify the data range?
 
Hi again,
I eventually managed to control the mathcad file inserting it in a excel file as a OLE object. Seems to work well, although it is not the cleanest thing in the world.
I was wondering if someone know how to send inputs to mathcad from a external source (.xls,.txt,.csv,...) and get the outputs back from mathcad to excel, etc... But doing all this without opening the mathcad file, but just creating a interface program in VB, that calls the M/C file and manages the data.
Thanks
 
If this is M14, the file format is XML, but what then? Your claim is that you needed Mathcad to run some calculations.

As for running mathcad, what's the issue? You shell to the DOS shell, and call the program with the file you want it to run. You have the Mathcad file output a .csv file and read it back in.


TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor