title: Error on google app script "TypeError: Cannot call method append row..)"
body: <p>I am a junior high school student and I am a beginner on using "Google App Script". Please help me in this line of code because I keep on getting error "TypeError: Cannot call method "appendRow" of null. (line 29, file "Code", project "AS_Score")". Here is my line of code: </p>
  
  <pre><code>function doGet(e){
  
    var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1gk1O4SkS09f96si3trbS0HcVRhXlQH5wc7LVCJ-xMus/edit#gid=0");
    var sheet = ss.getSheetByName("Sheet1");
  
    addUser(e,sheet);
  
  
  }
  
  
  function doPost(e){
  
    var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1gk1O4SkS09f96si3trbS0HcVRhXlQH5wc7LVCJ-xMus/edit#gid=0");
    var sheet = ss.getSheetByName("Sheet1");
  
    addUser(e,sheet);
  
  }
  
  
  
  function addUser(e,sheet) {
  
    var id = e.parameter.id;
    var name = e.parameter.name;
    var grade = e.parameter.grade;
    var subject = e.parameter.subject;
    var score = e.parameter.score;
  
    sheet.appendRow([id,name,grade,subject,score]);
  
  }
  </code></pre>
  
  <p>Please help me if I have any error, thank you!</p>