metamorph-inc / excel_wrapper

OpenMDAO Excel Wrapper (MS Windows only)
GNU General Public License v2.0
0 stars 0 forks source link

Add support for Excel Macro invocation #1

Open adamnagel opened 8 years ago

adamnagel commented 8 years ago

When the current Excel wrapper runs, it sets the values of some cells (the parameters), then reads the values of some other cells (the unknowns). However, it is common for a spreadsheet to include macros. These are code or plug-ins that can be invoked to perform calculations. In these cases, the "output" values of the spreadsheets are not updated until the macro is invoked.

Here are some of the improvements that will need to be made to support macros:

adamnagel commented 8 years ago

@lattmann has some pointers to learn more: https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._application.run.aspx https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.applicationclass.run.aspx

adamnagel commented 8 years ago

Macro functions can accept arguments. For this first version, do not worry about supporting macros that accept arguments. Assume that the macro extracts the information that it needs from the cells of the spreadsheet itself.

adamnagel commented 8 years ago

As a bonus, it would be nice for the class to have a singleton function that takes a pointer to an Excel spreadsheet as an input, and returns the list of macros included with that spreadsheet. It could help users discover and identify them properly.