/// <summary> /// Gets a list of all running Excel applications from the Running Object Table... in theory. In practise, due to Excel registering in the ROT with the same name every time, /// what you'll is x copies of the first Excel application, where x is the number of running Excel applications. This method remains just in case future versions of Office fix this /// issue, and because it could be useful to know how many instances of Excel are running. Each instance should be manually disposed. /// </summary> /// <returns>A list of Excel.Application objects</returns> public static IList <Application> GetRunningApplications() { return(Application.FromROT <Application>()); }
/// <summary> /// Retrieves all open Excel workbooks from the Running Object Table. Each instance must be manually disposed. /// </summary> /// <returns>A list of workbooks.</returns> public static IList <Workbook> GetAllOpen() { return(Application.FromROT <Workbook>()); }