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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Exporting results to Excel

tietjee
14-Alexandrite

Exporting results to Excel

I am running MathCAD 15 and Office 2007. I am trying to export results from a MathCAD calculation to an Excel workbook. MathCAD will not export the values and provides the error "The range value specified is invalid." There are two varibles that are exported, each to individual cells into a Excel worksheet. This is a multi sheet Excel macro enable work book. Is it possible to use the Insert Component to export varibles to a Macro-Enable Worksheet?

12 REPLIES 12

David Tietje wrote:

MathCAD will not export the values and provides the error "The range value specified is invalid."

Have you tried writing the result to a text file and having Excel read that file?

Do you have an example Mathcad file you can attach to you post?


RichardJ
19-Tanzanite
(To:tietjee)

I don't think it should make any difference whether or not macros are enabled. How are you doing the export? Via the WRITEEXCEL function?

tietjee
14-Alexandrite
(To:RichardJ)

I am trying to attached a zip with both the MathCAD and Excel files. I do not see the upload bottom. The Excel worksheet is macro-enabled. This is required to integrate with another program. The insert Component causes the error, and is highlighted in yellow. I am able to export the information using the WRITEEXCEL, which is highlighted in red.

regards,

RichardJ
19-Tanzanite
(To:tietjee)

Click on "Use Advanced Editor" at the top right of the editor window, then you will see the upload button at the bottom left.

tietjee
14-Alexandrite
(To:RichardJ)

Attached sample files

RichardJ
19-Tanzanite
(To:tietjee)

Your Excel component does not work for me, but that may be because I have an older version of Excel. If I convert your file to an xls file and then insert a new component, it works fine. An Excel component is not going to export the results though. When you create the Excel component it creates a copy of the Excel spreadsheet and embeds it in the Mathcad worksheet. That embedded copy is completely independent of the spreadsheet it was created from.

tietjee
14-Alexandrite
(To:RichardJ)

The process will work with the xlsx spreadsheets. The problem seems to be with macro-enabled embedded. For my application, embedded spreadsheets could be a problem. Thanks for pointing out the embedding feature of using components. Linking the spreadsheet may work. This sounds like a interesting detail with using Excel.

MikeArmstrong
5-Regular Member
(To:tietjee)

You should be able to write the data straight to Excel though. Why Di you need Macro's enabled if you don't mind me asking.

Mike

tietjee
14-Alexandrite
(To:MikeArmstrong)

The macro-enabled spreadsheet is required to support another program. The spreadsheet is part of the pre and post processing for the program.

MikeArmstrong
5-Regular Member
(To:tietjee)

You might be best writing from Excel from Mathcad to a none Macro sheet and then calling into the Macro sheet.

Mike

RichardJ
19-Tanzanite
(To:tietjee)

There is no way to directly link the spreadsheet. You can either embed it or write to it. The only way to link to a spreadsheet is to embed an Excel spreadsheet that in turn links to another Excel spreadsheet. That's a kludge, but it does work.

MikeArmstrong
5-Regular Member
(To:tietjee)

Sometimes Mathcad does have problems writing ranges to Excel.

I'll have a look in the morning unless someone helps beforehand.

Mike

Announcements

Top Tags