VBA macro not executing when called from a separate thread

O

Omatase

I am making the following call to a VBA macro in Word:

_wordApp.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod, null, _wordApp,
argumentList);

This call is successful when made from the main thread of my
application. When I make the same call from another, newly spawned,
thread, nothing happens. The call to the macro never returns and no
line in the macro is ever processed.

I'm sure this is a common problem for folks dealing with mutithreading
and vba macro calls but I didn't find anything in about it online. Is
there something I need to do differently to get this to work properly?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top