Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Cancel
6
  • Maybe you should enable Drive API first. Check this. Commented Feb 28, 2017 at 2:55
  • @SangbokLee Just did it, and script still not working
    – Mk1
    Commented Feb 28, 2017 at 10:21
  • You don't need to enable the Drive API to use DriveApp. Is this script attached to a spreadsheet? Commented Feb 28, 2017 at 13:03
  • @SpencerEaston I don't know really. The only line i find mentioning "spreadsheet" is this [ var file, data, sheet = SpreadsheetApp.getActiveSheet(); sheet.clear(); ] but i don't know if i should create a specific sheet or add name to code for it to work
    – Mk1
    Commented Feb 28, 2017 at 14:34
  • This script needs to be ran in a spreadsheet. Create a new spreadsheet. Click tools->Script editor. Add your code to the script that is opened. It should be able to run in that context. Commented Feb 28, 2017 at 14:42