最終更新日 :
2025年3月31日
説明
ファイルを開いたときに再計算される数式が Excel オブジェクトにあるかどうかを示す情報を取得します。
戻り値
式の再計算が true または false に設定されているスプレッドシートオブジェクトのブーリアンを返します。
履歴
ColdFusion(2025 リリース):関数が追加されました。
シンタックス
spreadsheetGetForceFormulaRecalculation(Object spreadsheet)
spreadsheetGetForceFormulaRecalculation(Object spreadsheet)
spreadsheetGetForceFormulaRecalculation(Object spreadsheet)
パラメーター
名前 |
必須 |
タイプ |
説明 |
spreadSheetObject |
はい |
ExcelInfo |
起動時に再計算する数式が含まれている Excel スプレッドシートオブジェクト。 |
例
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &"BookFormula.xlsx";
theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &"SpreadsheetSetPrintOrientationReadTrue.xlsx";
// 最初の xlsx ファイルを読み取ります
obj=SpreadsheetRead(#theFile#)
// 行 3 の列 1 に値 21 を設定します
SpreadsheetSetCellValue(obj,21, 3, 1)
// セル行 11、列 1 に数式を追加します
SpreadsheetSetCellFormula(obj, "SUM(A1:A9)", 11, 1)
// 数式を強制的に再計算します
SpreadsheetSetForceFormulaRecalculation(obj,true)
value=SpreadsheetGetForceFormulaRecalculation(obj)
writeoutput(value&"<br>")
spreadsheetWrite(obj,#theFile1#,", "yes", "no")
obj=SpreadsheetRead(#theFile1#)
theValue=SpreadsheetGetCellValue(obj,11,1);
writeoutput(#theValue# &"<br>")
theValue2=SpreadsheetGetCellValue(obj,14,1);
writeoutput(#theValue2#)
</cfscript>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &"BookFormula.xlsx";
theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &"SpreadsheetSetPrintOrientationReadTrue.xlsx";
// 最初の xlsx ファイルを読み取ります
obj=SpreadsheetRead(#theFile#)
// 行 3 の列 1 に値 21 を設定します
SpreadsheetSetCellValue(obj,21, 3, 1)
// セル行 11、列 1 に数式を追加します
SpreadsheetSetCellFormula(obj, "SUM(A1:A9)", 11, 1)
// 数式を強制的に再計算します
SpreadsheetSetForceFormulaRecalculation(obj,true)
value=SpreadsheetGetForceFormulaRecalculation(obj)
writeoutput(value&"<br>")
spreadsheetWrite(obj,#theFile1#,", "yes", "no")
obj=SpreadsheetRead(#theFile1#)
theValue=SpreadsheetGetCellValue(obj,11,1);
writeoutput(#theValue# &"<br>")
theValue2=SpreadsheetGetCellValue(obj,14,1);
writeoutput(#theValue2#)
</cfscript>
<cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) &"BookFormula.xlsx"; theFile1=GetDirectoryFromPath(GetCurrentTemplatePath()) &"SpreadsheetSetPrintOrientationReadTrue.xlsx"; // 最初の xlsx ファイルを読み取ります obj=SpreadsheetRead(#theFile#) // 行 3 の列 1 に値 21 を設定します SpreadsheetSetCellValue(obj,21, 3, 1) // セル行 11、列 1 に数式を追加します SpreadsheetSetCellFormula(obj, "SUM(A1:A9)", 11, 1) // 数式を強制的に再計算します SpreadsheetSetForceFormulaRecalculation(obj,true) value=SpreadsheetGetForceFormulaRecalculation(obj) writeoutput(value&"<br>") spreadsheetWrite(obj,#theFile1#,", "yes", "no") obj=SpreadsheetRead(#theFile1#) theValue=SpreadsheetGetCellValue(obj,11,1); writeoutput(#theValue# &"<br>") theValue2=SpreadsheetGetCellValue(obj,14,1); writeoutput(#theValue2#) </cfscript>