I'm working with Pega and using the framework of Excel to open and run some Macros. However, although I open and close the macros in the automation, sometimes they don't close in the runtime process. causing issues like "The workbook is already open". I wonder to know if there is a better way to ensure that my macro is closed before attempting to open another one.
In my experience, the RunMacro method of the connector is synchronous in that it doesn't return until the macro has completed. If your macro is returning early, that may be where you'll need to identify and make a change. The connector does not have any other means (at least out of the box) to perform any other functions with macros.