title: Google Apps Script, select a sheet - Sets values in first sheet tab - not a specific sheet tab
body: <p>The script provided seems to work, but it posts the data to the first sheet tab of the spreadsheet, when I'd like to have it post on a sheet entitled XML. </p>
  
  <p>I've tried changing <code>getActiveSheet()</code> to <code>getSheetByName("XML")</code> and a number of other things but have had no luck. Any ideas?</p>
  
  <pre><code>function getData() {
    var queryString = Math.random();
  
    var cellFunction1 = '=IMPORTXML("http://www.resources-game.ch/exchange/kurseliste.xml?' + queryString + '","//RESOURCES_RATES/ITEM")';
    SpreadsheetApp.getActiveSheet().getRange('A1').setValue(cellFunction1);
  
  }
  </code></pre>