Skip to content

Diagnostic reference

TypeError: e.range is not a function

Why calling e.range() fails in an onEdit trigger, and the fix: e.range is already a Range, not a function.

Updated September 12, 2026

Apps Script error

TypeError: e.range is not a function

What it means

e.range is already a Range object, not a function that returns one. Apps Script event objects expose plain properties such as e.range, e.value, and e.oldValue. Calling e.range() treats the property as a method and fails as soon as the trigger fires.

Related error messages

  • TypeError: e.value is not a function

Before and after

See the change before you make it.

Problem
function onEdit(e) {
  const cell = e.range();
  Logger.log(cell.getA1Notation());
}
Safer version
function onEdit(e) {
  const cell = e.range;
  Logger.log(cell.getA1Notation());
}

How to fix it

  • Read e.range directly; the edit event supplies a Range object.
  • Remove the call parentheses from e.range().
  • Test by editing a cell in the bound spreadsheet.

What stays with you

  • e exists only when the trigger fires; running onEdit by hand still needs a synthetic event.
  • myFunction does not install or fire triggers.