Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

613
Visualizações
Exception: The parameters (String) don't match the method signature for SpreadsheetApp.Sheet.activate

I have the following code working perfectly as desired... It completes all the tasks as expected but still populates a red error box advising me of an Exception. It's definitely completing all of the tasks, so I can't tell what I've got wrong in here but maybe I'm just using the wrong syntax somewhere? I'd appreciate any help.

Error Message: Exception: The parameters (String) don't match the method signature for SpreadsheetApp.Sheet.activate

Here is a link to my example sheet

function AddRoutedOptions() {
  var ui = SpreadsheetApp.getUi(); // Same variations.
  var result = ui.alert(
      'Add all Routed tasks to the Project Tracker?',
      'Are you sure you want to add all Routed tasks to the Project Tracker?',
      ui.ButtonSet.YES_NO);

  // Process the user's response.
  if (result == ui.Button.YES) {
    // User clicked "Yes".
  var pglc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Pre-Go Live Checklist');
  var vcc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Video Course Checklist');
  var rsc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Routed Setup Checklist').activate();
    pglc.getRange('B32:B35').copyTo(pglc.getRange('E23:E26'), {contentsOnly:true});
    vcc.getRange('B32:C37').copyTo(vcc.getRange('G10:H15'), {contentsOnly:true});
    rsc.activate('Routed Setup Checklist');
} else {
    // User clicked "No" or X in the title bar.
    ui.alert('No tasks were added.');
  }
}

function RemoveRoutedOptions() {
  var ui = SpreadsheetApp.getUi(); // Same variations.
  var result = ui.alert(
      'Remove all Routed tasks from the Project Tracker?',
      'Are you sure you want to remove all Routed tasks from the Project Tracker?',
      ui.ButtonSet.YES_NO);

  // Process the user's response.
  if (result == ui.Button.YES) {
    // User clicked "Yes".
  var pglc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Pre-Go Live Checklist');
  var vcc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Video Course Checklist');
  var rsc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Routed Setup Checklist').hideSheet();
    pglc.getRange('E23:E26').clearContent();
    vcc.getRange('G10:H15').clearContent();
    rsc.hideSheet('Routed Setup Checklist');
} else {
    // User clicked "No" or X in the title bar.
    ui.alert('No tasks were removed.')
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Sheet.activate() does not accept parameters

rsc.activate('Routed Setup Checklist');

ref

Try changing this:

var rsc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Routed Setup Checklist').activate();
    pglc.getRange('B32:B35').copyTo(pglc.getRange('E23:E26'), {contentsOnly:true});
    vcc.getRange('B32:C37').copyTo(vcc.getRange('G10:H15'), {contentsOnly:true});
    rsc.activate('Routed Setup Checklist');

to this:

var rsc = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Routed Setup Checklist');
    pglc.getRange('B32:B35').copyTo(pglc.getRange('E23:E26'), {contentsOnly:true});
    vcc.getRange('B32:C37').copyTo(vcc.getRange('G10:H15'), {contentsOnly:true});
    rsc.activate();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda