I would like to open each file in a folder via script. Below is what I have tried. This is my first shot at any script in sheets.
This code runs but does not open file, I could be a mile off on this but I can't figure out how to make it open the files. Thanks for your help
function myFunction() {
var dApp = DriveApp;
var folder = dApp.getFoldersByName("test").next();
var filesIter = folder.getFiles();
while(filesIter.hasNext()) {
var files = filesIter.next();
var ss = SpreadsheetApp.open(files);
}
}
I simply want it to open all the files in a folder in this case "test". there are currently two google sheets in the folder.
SpreadsheetApp.open()
and would likely not be possible purely in Apps Scripts. Or are you having issue using thess
variable after assigning the result of.open()
? – Joshua T