Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi Everyone!
I've been using Mathcad for a while and I believe it is a powerful tool. But in the last week I've been experiencing a problem. I need to create a dynamic link between Excel and Mathcad as the raw data I am working with is too much to be just copied or imported. There is a constant 'flow' of new information going straight into the excel file and I need it to be linked directly to Mathcad. (as we are talking here about thousands of results).
Will be very grateful if you can help me out! Thank you very much in advance!
Kate
You might want to post this to the Mathcad site, not the one for Creo Elements/Direct Modeling.
Kate SS wrote:
Hi Everyone!
I've been using Mathcad for a while and I believe it is a powerful tool. But in the last week I've been experiencing a problem. I need to create a dynamic link between Excel and Mathcad as the raw data I am working with is too much to be just copied or imported. There is a constant 'flow' of new information going straight into the excel file and I need it to be linked directly to Mathcad. (as we are talking here about thousands of results).
Will be very grateful if you can help me out! Thank you very much in advance!
Kate
Hi Kate,
Can you give a bit more detail about what it is that you need to do in terms of reading, writing and possibly viewing your data? How many rows of data are you dealing with and what is the format? Have you tried using the WRITEEXCEL and READEXCEL functions in M15?
Stuart
Well..
Rows are different every time- the last time they were 1500. And that is why it wasn't very useful just copying them. Also part of the informatioin and the formulas were set in Excel and some of the results obtained should be extracted as well. That is why I wanted a dynamic link where one is not supposed to copy or input the data every time but it is just automatically inputting. Then after Mathcad finishes the calculations the end results can be returned to the excel sheets.
In other words, Mathcad is just the model which executes the calculations because the formulas are too complicated to be put into Excel, but at the end everything goes back into the Excel sheets and one has a good set of data. And as you can see, doing that for 1500 rows every time is just too much unnecessary work.
Kate,
Try this thread for one method, pasting links to your main worksheet into a Mathcad component: http://communities.ptc.com/message/39965#39965 (look for jcc's message).
Stuart
I thought there should be a way for that to happen because Mathcad uses Fortran and I've been programming on Pascal. And there you can just establish such a link and every time you run the program, it automatically calculates the values you need and puts them somewhere you want.
I thought there should be a way for that to happen because Mathcad uses Fortran
Not sure where you got that idea. Mathcad doesn't use Fortran for anything.
If you just want Mathcad to do the calculations, but the input data is form Excel and the results are to be displayed in Excel, then what you probably want to do is call Mathcad from Excel. I have attached a really simple example of a VBA program that calls a Mathcad worksheet.
Hi Kate,
there are several ways, but I will give you one that works (I'm referring to MC 15)
This process can also be inversed i.e. to write out data. However, if the Excel file is open you can't neither read nor write from/to it.
Hope this helps
Raiko
Search about
SetComplex and GetComplex functions
you will find your answer
good luck
babakmz@gmail.com
Not sure if this will help the original poster.
Note that the thread started some 5 years ago...
Luc