How to stop C# code from waiting until a excel macro is finished

Viewed 299

I run a excel macro from c# using Microsoft.Office.Interop.Excel, however the C# code is paused until the long excel macro is finished. I want to run both at once. How to do this?

2 Answers

Run your code in separate thread, the easiest way to accomplish that is using standard .Net Task library this way :

Task.Factory.StartNew(() =>
{
    // Do something here
});
Related