From ff63d69d7871128e648f8e2a94eb6a4d1454a08f Mon Sep 17 00:00:00 2001 From: Uladzislau Miranchuk Date: Tue, 1 Aug 2023 18:58:27 +0300 Subject: [PATCH] fix: ability to save a formula as a string using the cell-based interface --- src/lib/GoogleSpreadsheetCell.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/GoogleSpreadsheetCell.ts b/src/lib/GoogleSpreadsheetCell.ts index 655b1cec..56fcc486 100644 --- a/src/lib/GoogleSpreadsheetCell.ts +++ b/src/lib/GoogleSpreadsheetCell.ts @@ -128,10 +128,8 @@ export class GoogleSpreadsheetCell { return this.value as string; } set stringValue(val: string | undefined) { - if (val?.startsWith('=')) { - throw new Error('Use cell.formula to set formula values'); - } - this.value = val; + this._draftData.valueType = 'stringValue'; + this._draftData.value = val || ''; } /**