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

WRITEEXCEL is corrupting Excel file

SOLVED
Highlighted
Level 8

WRITEEXCEL is corrupting Excel file

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?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: WRITEEXCEL is corrupting Excel file

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

Re: WRITEEXCEL is corrupting Excel file

What about Mathcad Prime?

Re: WRITEEXCEL is corrupting Excel file

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

Re: WRITEEXCEL is corrupting Excel file

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

Re: WRITEEXCEL is corrupting Excel file

hi,

 

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

Re: WRITEEXCEL is corrupting Excel file

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.

Re: WRITEEXCEL is corrupting Excel file

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.

 

Re: WRITEEXCEL is corrupting Excel file

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

Re: WRITEEXCEL is corrupting Excel file

Hi Luc,

 

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

 

Cheers

Terry

Re: WRITEEXCEL is corrupting Excel file

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