title: Why does Excel stop prompting to save user opened workbooks?
body: <p><strong>EDIT:</strong> I am a fool; this was not an excel glitch but a programmer error. There was a Worksheet.Application.DisplayAlerts = False I had forgotten about/missed in my original searching. Once I added the necessary Worksheet.Application.DisplayAlerts = True before closing the workbook everything works as it should.</p>
  
  <p>I've got an interesting glitch that I don't quite understand and I'm hoping someone can help me out.</p>
  
  <p>I have a vb.NET program that uses excel COM references to open an existing workbook, modify the file, save it and close it. Works like a charm. To minimize resource usage the program opens an excel application in the background when the user navigates to that part of the program and does not close it until the program is closed.</p>
  
  <p>If the user opens an excel file while my program is active the OS will use the excel app my program has opened in the background automatically. Not a problem, everything functions normally. If the user edits the file, excel will prompt them to save before closing the file. Once the user closes their workbook the excel application will return to the background. If the user closes my program the background excel application will close. If the user runs the modify function and closes my program, excel will behave normally when the user opens a workbook.</p>
  
  <p><strong>However!</strong> If the user leaves the program open after running the modify function, excel will no longer prompt them to save after modifying the file. It's irrelevant what workbook they open, that particular instance of excel will no longer prompt the user to save after modifications.</p>
  
  <p>I am not suppressing alerts for this particular function. I also have 5 similar functions in my program which operate in essentially the same fashion (open a workbook, modify it, save it &amp; close it). They all open excel the same way, before the user actually clicks the run button. Only the one causes the glitch.</p>
  
  <p>I'd really just like to understand what's happening here. In the interim I've changed my function to open excel after the user clicks the button to run button rather than on the fly beforehand. This is not ideal, however, because it's adding around 4 seconds to the execution of my function.</p>
  
  <p>I am using:</p>
  
  <p>Windows 10 Enterprise 1709 16299.371</p>
  
  <p>Excel 2016 MSO (16.0.7329.1051) 32-bit</p>
  
  <p>If you'd like any other version or general information please let me know. Thanks in advance for all your help, this site is a great resource!</p>