WOLFRAM

Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler
  • All Products
Consulting & Solutions
  • Wolfram Consulting
  • Industry Solutions
  • Solutions for Education
Learning & Support
  • Wolfram U Courses
  • Wolfram Language Resources
  • Wolfram Community
  • Support FAQs
  • Contact Support
Company
  • About Wolfram
  • Careers
  • Events
  • Educational Programs
  • All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
  • Your Account
  • User Portal
Search

Working in Mathematica  / Creating Excel Macros  /
Previous section-----Next section

Developing Macros

Setting Up a New Notebook

When developing Mathematica code, it is best to separate input and output definitions from the main analysis portion of the routine. This way your analysis code can be easily adapted to obtain inputs and send outputs anywhere.

Here is a sequence of Mathematica commands that performs some analysis.

This section defines inputs.

This section performs your analysis.

This section displays outputs.

To use this code as an Excel macro, you only need to load the ExcelLink package to modify the input and output sections. Before doing this, open Excel and type in the same inputs into the workbook locations indicated in the following.

This section loads required packages.

This section defines inputs from Excel.

This section performs your analysis.

This section returns outputs to Excel.

In this example, the input and output range is the same. This is a way of performing in-place evaluation.

Modifying an Existing Notebook

To convert an existing Mathematica notebook to be used as an Excel macro:

• Locate the cells in your notebook that define inputs to your analysis.
• Modify those cells to use values contained in Excel.
• Likewise, locate the cells in the notebook that display outputs of your analysis.
• Modify those cells to return results to Excel.

For more information, see Code Box Deployment.



  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Facebook X Twitch LinkedIn YouTube Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English
  • en