In .NET Framework 4.8 I can get a reference to an instance of Excel with:
excelApp = (Microsoft.Office.Interop.Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application");
I need to use .NET 8.0 now and found how to start a new instance of Excel but I still need to be able to get a reference to an instance that is already running. In .NET 8.0, Marshal does not have “GetActiveObject.”
How can I get a reference to a running instance of Excel in .NET 8.0?
Thanks,
Terry