ExcelScript.Application interface

ブックを管理する Excel アプリケーションを表します。

メソッド

calculate(calculationType)

Excel で現在開いているすべてのブックを再計算します。

getCalculationEngineVersion()

最後の完全な再計算に使用した Excel 計算エンジンのバージョンを返します。

getCalculationMode()

の定数で定義されているブックで使用される計算モードを返します ExcelScript.CalculationMode。 使用可能な値は、 です。Automaticここで、Excel は再計算を制御しますAutomaticExceptTables。この場合、Excel は再計算を制御しますが、Manualテーブルの変更は無視されます。ここで、計算はユーザーが要求したときに行われます。

getCalculationState()

アプリケーションの計算の状態を返します。 詳細は「ExcelScript.CalculationState」をご覧ください。

getCultureInfo()

現在のシステム カルチャ設定に基づいて情報を提供します。 これには、カルチャ名、数値の書式設定、およびその他のカルチャに依存する設定が含まれます。

getDecimalSeparator()

数値の小数点として使用される文字列を取得します。 これは、ローカルの Excel 設定に基づいています。

getIterativeCalculation()

反復計算設定を返します。 Windows および Mac 上の Excel では、設定が Excel アプリケーションに適用されます。 Excel on the webやその他のプラットフォームでは、設定がアクティブなブックに適用されます。

getThousandsSeparator()

数値の小数点の左側にある数字のグループを区切るために使用される文字列を取得します。 これは、ローカルの Excel 設定に基づいています。

getUseSystemSeparators()

Excel のシステム区切り記号を有効にするかどうかを指定します。 システム区切り記号には、小数点と桁区切り記号が含まれます。

setCalculationMode(calculationMode)

の定数で定義されているブックで使用される計算モードを返します ExcelScript.CalculationMode。 使用可能な値は、 です。Automaticここで、Excel は再計算を制御しますAutomaticExceptTables。この場合、Excel は再計算を制御しますが、Manualテーブルの変更は無視されます。ここで、計算はユーザーが要求したときに行われます。

メソッドの詳細

calculate(calculationType)

Excel で現在開いているすべてのブックを再計算します。

calculate(calculationType: CalculationType): void;

パラメーター

calculationType
ExcelScript.CalculationType

使用する計算の種類を指定します。 詳細は「ExcelScript.CalculationType」をご覧ください。

戻り値

void

/**
 * This script fully recalculates the entire workbook.
 * This code is useful when automatic recalculation is turned off
 * but later parts of the script rely on updated values.
 */
function main(workbook: ExcelScript.Workbook, workbookURL: string) {
  const application = workbook.getApplication();
  application.calculate(ExcelScript.CalculationType.fullRebuild);
}

getCalculationEngineVersion()

最後の完全な再計算に使用した Excel 計算エンジンのバージョンを返します。

getCalculationEngineVersion(): number;

戻り値

number

getCalculationMode()

の定数で定義されているブックで使用される計算モードを返します ExcelScript.CalculationMode。 使用可能な値は、 です。Automaticここで、Excel は再計算を制御しますAutomaticExceptTables。この場合、Excel は再計算を制御しますが、Manualテーブルの変更は無視されます。ここで、計算はユーザーが要求したときに行われます。

getCalculationMode(): CalculationMode;

戻り値

getCalculationState()

アプリケーションの計算の状態を返します。 詳細は「ExcelScript.CalculationState」をご覧ください。

getCalculationState(): CalculationState;

戻り値

/**
 * This script uses the fill color of the first cell to indicate the current
 * calculation state of the workbook.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the first cell in the first worksheet.
  const cell = workbook.getWorksheets()[0].getCell(0,0);

  // Get that cell's fill object.
  const cellFill = cell.getFormat().getFill();

  // Set the cell fill based on the calculation state.
  const calcState = workbook.getApplication().getCalculationState();
  switch (calcState) {
    case ExcelScript.CalculationState.pending:
      cellFill.setColor("Red");
      break;
    case ExcelScript.CalculationState.calculating:
      cellFill.setColor("Yellow");
      break;
    case ExcelScript.CalculationState.done:
      cellFill.setColor("Green");
      break;
  }
}

getCultureInfo()

現在のシステム カルチャ設定に基づいて情報を提供します。 これには、カルチャ名、数値の書式設定、およびその他のカルチャに依存する設定が含まれます。

getCultureInfo(): CultureInfo;

戻り値

getDecimalSeparator()

数値の小数点として使用される文字列を取得します。 これは、ローカルの Excel 設定に基づいています。

getDecimalSeparator(): string;

戻り値

string

getIterativeCalculation()

反復計算設定を返します。 Windows および Mac 上の Excel では、設定が Excel アプリケーションに適用されます。 Excel on the webやその他のプラットフォームでは、設定がアクティブなブックに適用されます。

getIterativeCalculation(): IterativeCalculation;

戻り値

getThousandsSeparator()

数値の小数点の左側にある数字のグループを区切るために使用される文字列を取得します。 これは、ローカルの Excel 設定に基づいています。

getThousandsSeparator(): string;

戻り値

string

getUseSystemSeparators()

Excel のシステム区切り記号を有効にするかどうかを指定します。 システム区切り記号には、小数点と桁区切り記号が含まれます。

getUseSystemSeparators(): boolean;

戻り値

boolean

setCalculationMode(calculationMode)

の定数で定義されているブックで使用される計算モードを返します ExcelScript.CalculationMode。 使用可能な値は、 です。Automaticここで、Excel は再計算を制御しますAutomaticExceptTables。この場合、Excel は再計算を制御しますが、Manualテーブルの変更は無視されます。ここで、計算はユーザーが要求したときに行われます。

setCalculationMode(calculationMode: CalculationMode): void;

パラメーター

calculationMode
ExcelScript.CalculationMode

戻り値

void