title: Is it better to show ProgressBar UserForms in VBA as modal or modeless?
body: <p>Is it better to show ProgressBar UserForms in VBA as modal or modeless? What are the best practices for developing progress indicators in VBA?</p>
  
  <p>Modeless UserForms require the use of <code>Application.Interactive = False</code>, whereas Modal UserForms by their very nature block any interaction with the application until the core procedure has finished, or is cancelled.</p>
  
  <p>If <code>Application.Interactive = False</code> is used, however, the Esc key interrupts code execution, so the use of <code>Application.EnableCancelKey = xlErrorHandler</code> and error handling (<code>Err.Number = 18</code>) is required in both the UserForm and the calling procedure.</p>
  
  <p>Resource intensive calling procedures can also result in <code>CommandButton_Click</code> and <code>UserForm_Activate</code> events misfiring in modeless UserForms.</p>
  
  <p>In general, progress indicators that use modal UserForms seem simpler, because the code that is being executed is fully contained in the UserForm module, and there is less need for passing of variables.</p>
  
  <p>The problem, however, with using modal UserForms for progress indicators is that a separate UserForm module is required for every procedure that needs a progress indicator, because the calling procedure has to be inside the UserForm_Activate procedure.</p>
  
  <p>So, while it is possible to have a single reusable progress indicator in a modeless UserForm, it will be less reliable than executing the code from within multiple modal UserForms.</p>
  
  <p>Which way is better?</p>
  
  <p>Thanks!</p>