using ExcelDna.Integration; using ExcelDna.IntelliSense; using Microsoft.Office.Interop.Excel; using RhSolutions.Services; using System.Net; using System.Net.Http; namespace RhSolutions.AddIn { class RhSolutionsAddIn : IExcelAddIn { public static Application Excel; public static HttpClient httpClient; public void AutoOpen() { Excel = (Application)ExcelDnaUtil.Application; httpClient = new HttpClient(); IntelliSenseServer.Install(); RegistryUtil.Initialize(); EventsUtil.Initialize(); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; } public void AutoClose() { IntelliSenseServer.Uninstall(); RegistryUtil.Uninitialize(); EventsUtil.Uninitialize(); } } }