cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

VBA and Prime 3.0?

jroth
4-Participant

VBA and Prime 3.0?

Hello,

I'm looking for docoumentation to use a VBA program to call up mathcad and have it calculate a spline for a data set, then send the data back to excel. I can locate my array I need to send in my data just fine, but I'm unsure how to call up MathCad.

As an example, here is the mathcad worksheet I'd like to send the data to with VBA. Please not that the data size changes in length depending on the collection run.

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:jroth)

Why do you think that would be possible with Prime?

There is no scriptable automation interface in Prime like we have in real Mathcad and the old Excel Mathcad Add-in was written for MC14/15 and Excel 2007 and never was updated.

As for the different ranges you could write the actual ranges in a specific cell in EXCEL and read this cell(s) first in your sheet and depending on the content of that cell(s) you read different data ranges.

View solution in original post

5 REPLIES 5
Werner_E
24-Ruby V
(To:jroth)

Why do you think that would be possible with Prime?

There is no scriptable automation interface in Prime like we have in real Mathcad and the old Excel Mathcad Add-in was written for MC14/15 and Excel 2007 and never was updated.

As for the different ranges you could write the actual ranges in a specific cell in EXCEL and read this cell(s) first in your sheet and depending on the content of that cell(s) you read different data ranges.

jroth
4-Participant
(To:Werner_E)

Werner,

So I am to then take your answer as there is no way to do some type of programming in Prime such as the attached files? If so, this would be a dissapointment, but I can try to do the programming similarly in MathCad 15.

Speaking of the Excel Add-in, would you be able to provide some more information on that? Is it capable of sending items to MathCad and back, or it is some other type of addon entirly?

Werner_E
24-Ruby V
(To:jroth)

Speaking of the Excel Add-in, would you be able to provide some more information on that? Is it capable of sending items to MathCad and back, or it is some other type of addon entirly?

Reading your post I thought you were addressing that add-in.

I never used that add-in as I see Mathcad as a replacement of Excel and not as an add-in for it. The add-in was written by Mathsoft/PTC employees and is not supported by PTC. Nevertheless is could (still can?) be downloaded from the PTC site. There is not much documentation available. As far as I understood the goal was to use Mathcad's routines while working in Excel (but why should we want to do this when we can work in MC?).

EDIT: The add-in is still offered free here: http://www.ptc.com/community/free-downloads.htm

Fred_Kohlhepp
23-Emerald I
(To:jroth)

My company "refreshes" my computer often enough that mainaining the EXCEL add-in wasn't a worthwhile effort, but

You can embed a Mathcad sheet as an OLE in an EXCEL sheet and pass data in and out with an EXCEL VBA macro. Mathcad 15 still supports the old "in0, in1,. . ." for inputs and "out0, out1, . . ." for outputs.

Don't know about Prime.

jroth
4-Participant
(To:Fred_Kohlhepp)

Fred,

Could you be more specific? I am having issues trying to get the variable back from MathCad as the correct number. I can open the application, and I can use SetValue to override the envirenment variable, but I'm unable to recalculate the sheet and retrieve the correct variable.

Top Tags