Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Range.getFormula() invalid return type

Aperta
#365 5 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@alison-mk ci sta già lavorando.

Dal 17/10/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Status: in backlog Type: product bug

Article URL
ExcelScript.Range interface - getFormula()

Describe the problem
Documentation (and the interface itself) suggests getFormula() is supposed to return a string.
Not the case.. getFormula() behaves like getValue() and can return non-string values

let sheet = workbook.getWorksheet("Env.data");
[ . . . ]
let aQ = sheet .getCell(1, 1);
let qFormula: string = aQ.getFormula();
try{
  qFormula = qFormula.startsWith('=') ? qFormula.slice(1) : qFormula;
}catch(e){
  console.log(typeof(qFormula));
  console.log(qFormula);
  throw e;
}

logs and error:

number
0
qFormula.startsWith is not a function

Screenshots
image

Lingua principale
TypeScript
Stelle
70
Fork
36
Merge medio
2g 17h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OfficeDev/office-scripts-docs-reference

Tutte le issue di OfficeDev/office-scripts-docs-reference

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.