Get Help

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- WRITEEXCEL is corrupting Excel file

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-14-2017
02:23 PM

10-14-2017
02:23 PM

Hi all! I'm currently using MathCad 15 and I can't seem to get the seem together the Excel function to work correctly. It keeps writing to excel and making the file corrupt and messing with the formating, making it impossible to write all the arrays to Excel is there something I'm doing wrong?

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
08:44 AM

10-16-2017
08:44 AM

Hi,

Final pair. Excel and MathCad.

To stop the formatting from getting changed and to allow auditing of both MathCad and Excel.

Workaround is in the Excel file create a "MathCad Export" worksheet tab. No formats on this worksheet.

On the actual worksheet for the job just set cells equal to corresponding cells on the MathCad Export sheet.

16 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-14-2017
02:31 PM

10-14-2017
02:31 PM

What about Mathcad Prime?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-15-2017
12:04 PM

10-15-2017
12:04 PM

I'm unable to use MathCad prime because our whole company uses 14/15

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
12:05 AM

10-16-2017
12:05 AM

hi,

sometimes it is better to stick to the one thing. the calculations you are trying to do can be done entirely in excel.

entry is only required in yellow cells. calculation cells can be simply copied/pasted down as required.

to do this you need to change the 4/0 designation in text to a 4.0 designation in number format.

On you mathcad sheet i cannot find the subscript(i) function so this may be your problem

Cheers

Terry

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
12:14 AM

10-16-2017
12:14 AM

hi,

sorry mistake in last file the voltage column also needs to be input so should be yellow input cells

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
02:21 AM

10-16-2017
02:21 AM

Hi,

You are doing nothing wrong. Have been messing with this today. Excel can save files in 2003 "xls" and no year designation "xlsx" MathCad 15 is designed to work with 2007 "xlsx" files acciording to help. Ten years of changes in Excel file standards has not been kept up with by PTC and it is unlikely they will.

You can in Excel name ranges like "Cables" and "Circuit1" etc.

'

On Excel to MathCad

Excel 2003 "xls" MathCad can read and when you input into MathCad using Insert|Data|FileInput choose Excel Files, browse to a file, choose an xls 2003 file with named sheets and ranges, next. In the drop down list boxes for "worksheet" and "named ranges" values are there to select matching those in the excel file. With Excel "xlsx" files nothing appears in the these dialog boxes you must write it yourself in the text box.

On Mathcad to Excel

You can cut and paste no worries. Use WRITEEXCEL only supports 2007 "xlsx" files. You can't use 2003 "xls". Using your example you do loose formats and do corrupt the file. I will experiment some more but I think the problem is the "xlsx" standard has moved on beyond the 2007 era in the last ten years. I have an old laptop running Excel 2007 so I will put it through its paces with WRITEEXCEL and its "xlsx" format to see if the versioning is the problem.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
03:39 AM

10-16-2017
03:39 AM

Hi,

Using Excel 2007 the same occurs.

Mathcad to Excel with WriteExcel mashes the format and you get corruption warnings on opening the excel file.

Excel to Mathcad the worksheet list box and named ranges list box are blank with xlsx but filled with values when using xls 2003 files.

What we need is PTC to get the thing to work in Mathcad 15.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
04:50 AM

10-16-2017
04:50 AM

Idle hope, I'm afraid.

PTC is putting all their efforts in Prime. All their efforts? Yes, except when a really important bug needs fixing.

Mathcad (15) documentation states which versions of Excell are supported.

Writing to Excell files of unsupported version is not a bug, but a lack of functionality.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
05:32 AM

10-16-2017
05:32 AM

Hi Luc,

The problem of writing to an Excel file is to the supported file type. Looking for a work around now.

Cheers

Terry

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-16-2017
06:24 AM

10-16-2017
06:24 AM

Hi,

Enclosed is a MathCad worksheet that simplifies input and calculation of the circuit parameters.

Input takes in all the circuit inputs for one/each circuit into a matrix. One matrix for cable data. Three values epsilon, MVAbase and kVbase.

This is far less cluttered than the way you were doing it. You only need read eight main matrices.

Calculations are done once in the program and just reused.

I have not copied the MathCad results to the spreadsheet. Just wanted to show you a neater way to set out the Mathcad worksheet..

Enclosed is a slightly reworked spreadsheet I just moved a couple of columns around to keep inputs together.

The spreadsheet calculates the results itself. They are not copied from Mathcad.

Cheers

TH

Top Tags