Tengo un script en una hoja de calculo de google que funciona perfectamente pero solo con mi usuario, cuando otro usuario hace la accion que ejecuta el script, este no funciona aunque el usuario le de permiso en su cuenta, alguna solucion?
Dejo un enlace al ejemplo de la hoja de calculo que meciono:
https://docs.google.com/spreadsheets/d/1y5H1x84tyt43HEhtescDmuL-cXPHhL8KzJ2MkT_3eZo/edit?usp=sharing
Dejo un ejemplo del codigo aqui:
function onEdit(e){
var curDate = Utilities.formatDate(new Date(), "GMT+01:00", "hh:mm");
var range = e.range;
var colIndex = range.getColumnIndex(); //Same as getColumn()
var rowIndex = range.getRowIndex(); //Same as getRow()
var DateCol1 = "K9"; //Cell you want to have the date
var DateCol2 = "U9";
if(e.range.getSheet().getName() === 'PARCMÒBIL'){
var watchRange1 = {
top : 11, // start row
bottom : 109, // end row
left : 3, // start col
right : 11, // end col
};
var watchRange2 = {
top : 11, // start row
bottom : 109, // end row
left : 13, // start col
right : 21, // end col
};
if(colIndex >= watchRange1.left && colIndex <= watchRange1.right &&
rowIndex >= watchRange1.top && rowIndex <= watchRange1.bottom && e.Value
!= 0){
SpreadsheetApp.getActiveSheet().getRange(DateCol1).setValue(curDate);
//Write the date in the cell
}else if (colIndex >= watchRange2.left && colIndex <= watchRange2.right
&& rowIndex >= watchRange2.top && rowIndex <= watchRange2.bottom &&
e.Value !=0){
SpreadsheetApp.getActiveSheet().getRange(DateCol2).setValue(curDate);
};};
}
console.log(mensaje)
) para que puedas verificar que efectivamente se está llamando al script y que las condiciones están funcionando correctamente. – Rubén el 17 ene. 19 a las 17:20