Mathematica notebooks can automatically generate an associated package file. This provides an easy way to export a set of Mathematica commands that can be used as a one-click workbook processing macro. To create a package file, follow the steps outlined for creating a function definitions package file outlined in Package Deployment. The only difference is, in this case, you will save a sequence of macro commands to the package file instead of a set of function definitions. You should now have .nb, .m, and .xls files in the same directory with the same name. In the future, every time you save changes to the notebook, the package file is automatically updated. In turn, the next time you click Evaluate in Excel, the new workbook processing macro will be used. Notes • If you would like the kernel to close after workbook processing is complete, include Quit[] as the last line of your macro. |