Application VisualBasic Script

Sub ToggleGridlines()
    ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub