Interrupt running Excel VBA from C#

142 views Asked by At

Everything I have read suggests this is impossible, but maybe someone knows something I do not.

I developed middle-ware in C# for running different programs via COM or .NET interfaces. The other programs allow you to run them asynchronously, and interrupt the calculation if necessary.

One of the program options is Excel, where the middle-ware will launch Excel and run VBA code named by the user. I would like to interrupt running Excel VBA from C# as I can with the other programs. There does not appear to be any way to do this, as the Run(macro) call is blocking and returns when the VBA code completes.

There are _Run2(macro) and _Wait() calls, which suggests there might be some way to do it, but these are for internal use, so they are intentionally poorly documented.

0

There are 0 answers