Ir para conteúdo
Fórum Script Brasil

Denil

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Posts postados por Denil

  1. Amigos, é minha primeira tentativa. Estou ajustando um script para cadastro em uma planilha, mas acontece esse erro na depuração.

    TypeError: Cannot read property 'Ticker' of undefined (linha 31, arquivo "Macro1_FormTrans")

    Alguém sabe me dizer o que está errado?

     

    var url = "https://docs.google.com/spreadsheets/d/1ZH3HGhffznHlQfC-pD7R4yE4Lay5blQf6Tp2rIM5NT8/edit#gid=1630204909"

    function FormTrans(){

      

      var Form = HtmlService.createTemplateFromFile("FormTrans");

      var MostrarForm = Form.evaluate();

      

      MostrarForm.setTitle("Cadastrar Transação").setHeight(400).setWidth(550);

      

      SpreadsheetApp.getUi().showModalDialog(MostrarForm, "Cadastrar Compra")  

      }

    function SalvarTrans(Dados){

      var Planilha = SpreadsheetApp.openByUrl(url);

      var Guia = Planilha.getSheetByName("Transações");

        

      Guia.getActiveCell();

      Guia.getRange('A1').activate();

      

      Guia.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();

      

      Guia.getActiveCell().offset(1, 0).activate();

       

      var Linha = Guia.getCurrentCell().getRow();

      

      var Data = new Date();

      

      Guia.getRange(Linha, 1).setValue([Dados.Ticker]);

      Guia.getRange(Linha, 2).setValue([Dados.Data]);

      Guia.getRange(Linha, 3).setValue([Dados.Quant]); 

      Guia.getRange(Linha, 4).setValue([Dados.Valor]);

      Guia.getRange(Linha, 5).setValue([Dados.Taxa]);

      

      return 'Cadastrado com Sucesso';

      

      }

     

    Agradeço a atenção.

     

     

×
×
  • Criar Novo...