Many of the features associate with DocList and DriveApp appear identical.


I am planning on using the following code to create a series of spreadsheets

  function createSpreadSheet(sheetO,valuesO,rangeN,folderD){
    var ssNew = SpreadsheetApp.create(ssName);//creates a new spreadsheet
    var ssNewKey = ssNew.getId();//captures key of new spreadsheet
    Logger.log('New sheet made with key:'+ssNewKey);//logs the new key
    var file = DriveApp.getFileById(ssNewKey);
    var root = DriveApp.getRootFolder();//all files are created in the 'root folder', they must be have a new directory added and then be removed from the old directory.
    file.addToFolder(folderD);//adds new directory
    file.removeFromFolder(root);//removes file from 'root'
    var sheetN = ssNew.getSheets()[0];//calls first 'sheet1'
    sheetN.getRange(rangeN).setValues(valuesO).setBackgrounds(bkgrndsO);//sets values of cells within rangeN to valuesO
}

I haven't finished building the structure of valuesO and rangeN yet, but I am not sure if I should be using DriveApp for this or DocList. Is there a difference that would impact what I am trying to do?

有帮助吗?

解决方案

DriveApp is newer and should be preferred if possible.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top