1
votes

I am new bee trying to use google app scripts. I am trying to copy spreadsheet using

var copySheet=spreadSheetCurrent.copy(date.toString('yyyy-MM-dd'));

this is also making a copy of the form associated with this spreadsheet, can I just copy only the spreadsheet ?

1
You can create an empty one and copy all its data. Is it ok to you? If is I will post an example. - br araujo

1 Answers

1
votes

You can copy with this script:

function doCopy() {
  var srcSpread = SpreadsheetApp.openById("0AkkQD4hSd4KAdEdyZHM4Xzd3QjMwdDVxazVLOTBFN2c");
  var destSpread = SpreadsheetApp.create("Copy of Plan X");

  for(var idx in srcSpread.getSheets()) {
    srcSpread.getSheets()[idx].copyTo(destSpread);
  }
}

Shared here.