Skip to content

Instantly share code, notes, and snippets.

@jakelosh
Created June 24, 2013 16:43
Show Gist options
  • Save jakelosh/5851519 to your computer and use it in GitHub Desktop.
Save jakelosh/5851519 to your computer and use it in GitHub Desktop.
This is a sub I wrote to turn off certain application features in Excel that I often toggle while running scripts. You feed it a bool and it toggles accordingly.
Public Sub OffAutos(ByVal bolState As Boolean)
If bolState = True Then
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.DisplayAlerts = False
.AskToUpdateLinks = False
End With
Else
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.DisplayAlerts = True
.AskToUpdateLinks = True
End With
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment