Deactivate cell/desactivar celda

103 views
Skip to first unread message

Elkin Delgado

unread,
Aug 24, 2022, 2:07:35 PM8/24/22
to Google Apps Script Community

first, sorry about my english

 I try to delete or save information of a cell, but when cell is active the function do not work. do not delete or save the content of that cell. ¿how i solve that?

if cells are deactivates funtion works correctly

img.png

Estoy tratando de borrar o guardar la información de una celda usando appscript, sin embargo cuando la celda queda activa, no guarda o borra la información de esa celda,  ¿Cómo hago para desactivar la celda? o ¿Cómo soluciono este inconveniente?

cuando las celdas estan desactivadas funciona correctamente la funcion




function Limpiar(){
  var Hoja_Calculo = SpreadsheetApp.getActive();//Obtener hoja de calculo
  var Nombre_Hoja = Hoja_Calculo.getActiveSheet().getName();//Obtener nombre de una hoja
  var Hoja_Activa = Hoja_Calculo.getSheetByName(Nombre_Hoja);//Traer la hoja en la que se esta trabajando
  var rango_limpiar = ["E8", "E10", "E12", "E14", "E16", "E18", "E20"];
 
  for (var i=0; i<rango_limpiar.length;i++){
    Hoja_Activa.getRange(rango_limpiar[i]).clearContent();
  } 
}



Clark Lind

unread,
Aug 25, 2022, 11:12:00 AM8/25/22
to Google Apps Script Community
I think the nature of Google sheets (many people editing at one time) it prevents changes to a cell that is currently being edited. "Active" is not the same as "Being edited". 
I do not think there is a way to interact with a cell that is currently being edited. 

Elkin Delgado

unread,
Aug 25, 2022, 11:26:48 AM8/25/22
to google-apps-sc...@googlegroups.com
I try to disable it 
But i can't do it
Ando i try actívate another cell and then there are 2 cells activate
 
--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/9x-sUz0ko5w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/c026116a-987d-4ac1-8f03-80fcdaa448ben%40googlegroups.com.

Clark Lind

unread,
Aug 25, 2022, 4:24:45 PM8/25/22
to Google Apps Script Community
Any cell that is in an "edit" state (is being edited) can not be changed until the edit is completed.
Reply all
Reply to author
Forward
0 new messages