I created a timer
void Application_DocumentOpen(Microsoft.Office.Interop.Word.Document Doc)
{
System.Timers.Timer timer=new System.Timers.Timer(30000);
timer.Elapsed += (sender, e) => ExcelFileSendToAPI(Doc.FullName);
timer.Start();
}
ExcelFileSendToAPI method makes an api request every 30 seconds after the file is opened. There is nothing wrong but Even if I open 2 excel applications and close an excel application, it continues to make requests in the background. How can I turn off the timer after the application is closed?
This problem exists in word, excel and powerpoint.
question from:https://stackoverflow.com/questions/66046359/excel-word-timer-continues-even-if-i-turn-off