title: Separate subroutine for application methods?
body: <p>Right now I'm in the middle of writing a mildly complicated network of Excel workbooks that is almost entirely driven by VBA automation, so there are lots of macros being written.</p>
  
  <p>I try and disable screenupdating, alerts, and events wherever possible. To save some time and headaches in tracking down where I may have enabled/disabled these, I've written a subroutine where the desired settings for each are passed in as arguments, so you can set up what you want enabled/disabled in one line of code (or at least that's the idea anyway).</p>
  
  <p>This is what that subroutine looks like:</p>
  
  <pre><code>Sub AppToggles(Optional ScrUpdating As Boolean = False, _
                 Optional DispAlerts As Boolean = True, _
                 Optional Events As Boolean = False)
  
  With Application    
     .ScreenUpdating = ScrUpdating
     .DisplayAlerts = DispAlerts
     .EnableEvents = Events
  End With    
  
  End Sub
  </code></pre>
  
  <p>I call it from various other subroutines in the same module with <code>Call AppToggles(True, True, True)</code> (or whatever combination is desired.</p>
  
  <p>Problem is, the subroutine doesn't seem to do anything. It's such a simple routine that stepping through it tells me nothing. Hovering over the keywords shows me that each switch is not being set to the arguments passed.</p>
  
  <p>I could set up an If statement for each one I suppose, but I'm curious as to where I fell off the tracks :P</p>