Excel Integration with Maple
Copyright Maplesoft, a division of Waterloo Maple Inc., 2007
Introduction
With the release of Maple 11, data integration from Excel? data files has become a smooth and virtually effortless process.
This tips and techniques article will demonstrate how to import Excel generated data, modify it, and then export the data as an Excel spreadsheet. It will also cover what the Maple Excel add-in is and provide an example of how to use it.
How can I import Excel data?
Maple 11 supports .xls files which can be imported using the interactive assistant or by calling the corresponding command.
Using the interactive assistant:
To do this programmatically, the command needed is ExcelTools[Import].
Entering the following command will launch the Data Import Assistant.
However, if you do not want to use the interactive assistant at all, you do have the option of specifying any (or all) of the following parameters: file name, sheet name, range of cells.
For example:
Then the data is imported into your document as a 2 dimensional Array (which is stored as an rtable), with both indices starting from 1.
For the Maple help page click here .
Modifying the data
Once the data has been imported, it becomes a Maple object and you do have the ability to make changes. To modify the data double click on the summary format to launch the Matrix Browser. The Matrix Browser will display your data and changes can be made, after you have made the necessary changes click Done.
You also have the option to modify the data using Maple commands, as with any other Array.
Note - By default, the summary format is displayed if the rtable imported is greater than a 10 by 10 Array.
How can I export data as an Excel file?
In Maple, large arrays, vectors, matrices, or higher dimensional rtables are displayed using a summary format. The contents of these objects are hidden and can be viewed by using the interactive Matrix Browser. Along with displaying the contents and providing the ability to make changes to the data, this interactive tool allows you to export data to an Excel spreadsheet. To launch the Matrix Browser, double-click the object, that is, the summary format. If you would like to make any changes to your data, you can do so here by clicking in the cell and modifying the contents. Click the Export button in the Browse Matrix. The Export to Excel dialog opens.
Note - If the file you are trying to save to is open or in use you will receive an error message 'file not found'. Ensure that the file selected is closed.
To access these tools using the commands you would use ExcelTools[Export]. Unlike the Import command, this command requires at least one parameter - the name of the Array to be exported. You can still specify a file name, sheet name, and cell range respectively, although these parameters are optional.
The command below will launch the interactive Export to Excel dialogue box.
To avoid interacting with the dialogue box you will need to specify the Array to be exported along with a file name. The other parameters, sheet name, and cell range remain optional.
For the Maple help page, click here .
How do I use the Maple Excel Add-in?
The Maple Excel add-in allows you to call Maple commands from within an Excel Spreadsheet
To enable the Maple Excel Add-in: From Excel's Tools menu, choose Add-Ins
Note - If you are using a version of Microsoft? Office that is not English, French, or German, the Maple Excel Add-in is not listed. To make the Add-in available: a) Click Browse and navigate to the directory in which Maple is installed. b) In the Excel directory, select the WMIMPLEX.xla file. c) Click OK.
With this add-in you have access to a subset of the Mathematics section of the Maple help system and a Maple Function Wizard to step you through the creation of a Maple function call.
Example
This example will demonstrate how the Maple Excel add-in works. It will calculate the derivative of a function, plot the function and its derivative, and display the results inside Excel.
Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.