spreadsheetGetForceFormulaRecalculation

説明 

ファイルを開いたときに再計算される数式が Excel オブジェクトにあるかどうかを示す情報を取得します。 

戻り値 

式の再計算が true または false に設定されているスプレッドシートオブジェクトのブーリアンを返します。 

履歴 

  • ColdFusion(2025 リリース):関数が追加されました。 

シンタックス 

spreadsheetGetForceFormulaRecalculation(Object spreadsheet)
spreadsheetGetForceFormulaRecalculation(Object spreadsheet)
spreadsheetGetForceFormulaRecalculation(Object spreadsheet)

パラメーター 

 

名前 

必須 

タイプ 

説明 

spreadSheetObject 

はい 

ExcelInfo 

起動時に再計算する数式が含まれている Excel スプレッドシートオブジェクト。 

 

<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;BookFormula.xlsx&quot;;
theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;SpreadsheetSetPrintOrientationReadTrue.xlsx&quot;;
// 最初の xlsx ファイルを読み取ります
obj=SpreadsheetRead(#theFile#)
// 行 3 の列 1 に値 21 を設定します
SpreadsheetSetCellValue(obj,21, 3, 1)
// セル行 11、列 1 に数式を追加します
SpreadsheetSetCellFormula(obj, &quot;SUM(A1:A9)&quot;, 11, 1)
// 数式を強制的に再計算します
SpreadsheetSetForceFormulaRecalculation(obj,true)
value=SpreadsheetGetForceFormulaRecalculation(obj)
writeoutput(value&&quot;<br>&quot;)
spreadsheetWrite(obj,#theFile1#,&quot;, &quot;yes&quot;, &quot;no&quot;)
obj=SpreadsheetRead(#theFile1#)
theValue=SpreadsheetGetCellValue(obj,11,1);
writeoutput(#theValue# &&quot;<br>&quot;)
theValue2=SpreadsheetGetCellValue(obj,14,1);
writeoutput(#theValue2#)
</cfscript>
<cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;BookFormula.xlsx&quot;; theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;SpreadsheetSetPrintOrientationReadTrue.xlsx&quot;; // 最初の xlsx ファイルを読み取ります obj=SpreadsheetRead(#theFile#) // 行 3 の列 1 に値 21 を設定します SpreadsheetSetCellValue(obj,21, 3, 1) // セル行 11、列 1 に数式を追加します SpreadsheetSetCellFormula(obj, &quot;SUM(A1:A9)&quot;, 11, 1) // 数式を強制的に再計算します SpreadsheetSetForceFormulaRecalculation(obj,true) value=SpreadsheetGetForceFormulaRecalculation(obj) writeoutput(value&&quot;<br>&quot;) spreadsheetWrite(obj,#theFile1#,&quot;, &quot;yes&quot;, &quot;no&quot;) obj=SpreadsheetRead(#theFile1#) theValue=SpreadsheetGetCellValue(obj,11,1); writeoutput(#theValue# &&quot;<br>&quot;) theValue2=SpreadsheetGetCellValue(obj,14,1); writeoutput(#theValue2#) </cfscript>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;BookFormula.xlsx&quot;;
    theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &&quot;SpreadsheetSetPrintOrientationReadTrue.xlsx&quot;;
    // 最初の xlsx ファイルを読み取ります
    obj=SpreadsheetRead(#theFile#)
    // 行 3 の列 1 に値 21 を設定します
    SpreadsheetSetCellValue(obj,21, 3, 1)
    // セル行 11、列 1 に数式を追加します
    SpreadsheetSetCellFormula(obj, &quot;SUM(A1:A9)&quot;, 11, 1)
    // 数式を強制的に再計算します
    SpreadsheetSetForceFormulaRecalculation(obj,true)
    value=SpreadsheetGetForceFormulaRecalculation(obj)
    writeoutput(value&&quot;<br>&quot;)
    spreadsheetWrite(obj,#theFile1#,&quot;, &quot;yes&quot;, &quot;no&quot;)
    obj=SpreadsheetRead(#theFile1#)
    theValue=SpreadsheetGetCellValue(obj,11,1);
    writeoutput(#theValue# &&quot;<br>&quot;)
    theValue2=SpreadsheetGetCellValue(obj,14,1);
    writeoutput(#theValue2#)
</cfscript>

ヘルプをすばやく簡単に入手

新規ユーザーの場合