title: Google Spreadsheet Script problem - Error: Service Times Out: Apps Script
body: <p>I've been trying to whip up a quick google script to count rsvps for the invite response spreadsheet for a wedding.  The script worked perfectly for a week as new entries were added to the spreadsheet, then suddenly stopped working with the following error message in each cell:</p>
  
  <p>Error: Service Times Out: Apps Script</p>
  
  <p>The script itself is simple.  It queries the relevant column (there are multiple events) and then checks to see whether there is some response spefied by the user - "YES", "NO", or a blank, typically.  </p>
  
  <p>What does this error mean, and does anyone have any suggestions for fixes?</p>
  
  <pre><code>function sumRSVP(response, rsvpType) {
    var rsvpCol = 7;
    if (rsvpType == "rehearsal") rsvpCol = 8;  
    if (rsvpType == "brunch") rsvpCol = 9;
  
    var mySum = 0;
  
    var sh = SpreadsheetApp.getActiveSheet();
    for( i=2; i&lt;177; i++){
  
      var rsvp = sh.getRange(i, rsvpCol).getValue();
      var nguests = sh.getRange(i, 6).getValue();
      if(nguests != "" &amp;&amp; rsvp == response){
        mySum = mySum + parseFloat(nguests);
      }
    }
  
    return mySum;
  }
  </code></pre>