Mathcad Integration with Microsoft Excel 2007

Mathcad integration with Microsoft Excel 2007
The new Mathcad 15.0 release has improved Microsoft Excel 2007 support. Previously Mathcad only supported Microsoft Excel 2003 .xls format but now supports Microsoft Excel 2007 .xlsx and .xlsm formats. Previously methods of integrating data from excel to Mathcad can still be used however several new functions which support Excel 2007 (Open XML) formats have been included and will be discussed in this article. 

READEXCEL and WRITEEXCEL
The new READEXCEL and WRITEEXCEL functions to read and write data to and from Excel 2007 file format. The READEXCEL(“file”, range”) returns a matrix from a defined range in an Excel worksheet. A “file” refers to a string containing the filename or the full pathname and filename. The .xlsx file extension must be included for example e.g. Sample.xlsx. The “range” refers to a string containing the cell range to read. For example, Sheet1! A1:B11. The string indicates the sheet name, the top left cell and the bottom right cell. Text is read in as strings.


 
The WRITEEXCEL(M, "file") writes M to an Excel file, where M is a matrix of scalars. If M contains units, strings, functions, or matrices, Mathcad cannot write the file. Ensure that the excel file you are writing to is closed.


Once you open your excel file you should see that Mathcad has written your matrix directly into the excel file. This function allows you to quickly interchange data between file types without losing any information.

READCSV and WRITECSV

The new READCSV and WRITE CSV functions for access to data files in comma-separated value format. The READCSV("file", [rows], [cols], [emptyfill], [delimiter]) returns an array containing the comma separated value data in file. The file refers to a string containing the filename or full pathname and filename. The rows (optional) can be either a scalar specifying the first row to read, or a 2-element vector specifying the range of rows (inclusive) to read. If this argument is omitted, READCSV reads in every row of the file. The cols (optional) is either a scalar specifying the first column to read from the file or a 2-element vector specifying the range of columns (inclusive) to read from the file. Likewise if this argument is omitted, READCSV reads in every column of the file. NOTE: Both rows and cols are indexes that start with 1. ORIGIN does not affect the behavior of READCSV.
The emptyfill (optional) is a string, scalar or NaN (not a number), which is substituted for missing entries in the data file. NaN is the default. The delimiter (optional) a single-character string, for e.g. a semi-colon (;). Use this string as the field delimiter in place of comma.

 

In this example, the rows, columns, emptyfill and delimiter values have been left out which tells Mathcad to read all columns and rows and emptyfill and delimiters have been set to default settings.

The WRITECSV(M, "file") writes array M to the comma separated values data file. M again refers to a matrix of values which will be written to the specified file. The process here is identical to the WRITEEXCEL function which allows you to insert a matrix into a CSV file.


 
Likewise with the WRITEEXCEL function, once you open your csv file you should see that Mathcad has written your matrix directly into the excel file, saving time and improving efficiency.


Mathcad 15.0 provides improved support for Microsoft Excel 2007 which makes integration quicker, easier and more efficient. Mathcad’s ability to integrate between Excel means that changes can be made directly to a file without having to go to the file source and update data. Gone are the days when transferring information between software programs could lead to loss of information, confusion and frustration. With Mathcad 15.0 transferring information from Mathcad to Excel and back again means companies can focus on more important matters of the design process and new users are still able to use Excel for data entry with the added power of Mathcad functionality.

SME enterprises may buy Mathcad in Australia from CADDIT.net.

Login User



Copyright © 2017 CAD CAM Australia. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.