This macro works for me but indeed after trying it launches the requested macro before the document is displayed in SolidWorks so the macro must be launched before the document is displayed, you have to find another macro to make this kind of request.
By the way, I don't understand what you mean by "I also replaced 'swRunMacroUnloadAfterRun' with 1 and 'runMacroError' with 0"
It's just to simplify the reading on the forum. But it's the same thing.
In my opinion the solution would be to open the document, the past in solved, rebuild and then run this kind of macro
But concretely I think it would be easier to work only in excel for this kind of thing.
Totally agree with @mandragorethis kind of macro becomes a problem very quickly because it's impossible to know if it's launched when it needs to or not, and no feedback if it runs well or if it just started and then bugged. Launching a macro from a macro to have already done it is not great.
And since a macro feature, it's even worse and may make you change your mind quickly, believe me it's experienced, I've been there before, I tested the 2 with a quick rewind due to many problems.
The goal is to generate this PDF plan automatically from a web platform. So by definition, it will be fully automatic. if an incident prevents the creation of the PDF, I think I can be alerted at a level other than SW.
It is possible to attack the API in C++. I haven't found a topic on this forum. Do you know how well it works?