Excel.Application class
Represents the Excel application that manages the workbook.
- Extends
Remarks
[Api set: ExcelApi 1.1]
Properties
| calculation |
Returns the Excel calculation engine version used for the last full recalculation. |
| calculation |
Returns the calculation mode used in the workbook, as defined by the constants in |
| calculation |
Returns the calculation state of the application. See |
| context | The request context associated with the object. This connects the add-in's process to the Office host application's process. |
| culture |
Provides information based on current system culture settings. This includes the culture names, number formatting, and other culturally dependent settings. |
| decimal |
Gets the string used as the decimal separator for numeric values. This is based on the local Excel settings. |
| iterative |
Returns the iterative calculation settings. In Excel on Windows and Mac, the settings will apply to the Excel Application. In Excel on the web and other platforms, the settings will apply to the active workbook. |
| thousands |
Gets the string used to separate groups of digits to the left of the decimal for numeric values. This is based on the local Excel settings. |
| use |
Specifies if the system separators of Excel are enabled. System separators include the decimal separator and thousands separator. |
Methods
| calculate(calculation |
Recalculate all currently opened workbooks in Excel. |
| calculate(calculation |
Recalculate all currently opened workbooks in Excel. |
| load(options) | Queues up a command to load the specified properties of the object. You must call |
| load(property |
Queues up a command to load the specified properties of the object. You must call |
| load(property |
Queues up a command to load the specified properties of the object. You must call |
| set(properties, options) | Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. |
| set(properties) | Sets multiple properties on the object at the same time, based on an existing loaded object. |
| suspend |
Suspends calculation until the next |
| suspend |
Suspends screen updating until the next Note*: Don't call |
| toJSON() | Overrides the JavaScript |
Property Details
calculationEngineVersion
Returns the Excel calculation engine version used for the last full recalculation.
readonly calculationEngineVersion: number;
Property Value
number
Remarks
[Api set: ExcelApi 1.9]
calculationMode
Returns the calculation mode used in the workbook, as defined by the constants in Excel.CalculationMode. Possible values are: Automatic, where Excel controls recalculation; AutomaticExceptTables, where Excel controls recalculation but ignores changes in tables; Manual, where calculation is done when the user requests it. This is a runtime property. The calculationMode setting is not persisted in the workbook.
calculationMode: Excel.CalculationMode | "Automatic" | "AutomaticExceptTables" | "Manual";
Property Value
Excel.CalculationMode | "Automatic" | "AutomaticExceptTables" | "Manual"
Remarks
[Api set: ExcelApi 1.1 for get, 1.8 for set]
calculationState
Returns the calculation state of the application. See Excel.CalculationState for details.
readonly calculationState: Excel.CalculationState | "Done" | "Calculating" | "Pending";
Property Value
Excel.CalculationState | "Done" | "Calculating" | "Pending"
Remarks
[Api set: ExcelApi 1.9]
context
The request context associated with the object. This connects the add-in's process to the Office host application's process.
context: RequestContext;
Property Value
cultureInfo
Provides information based on current system culture settings. This includes the culture names, number formatting, and other culturally dependent settings.
readonly cultureInfo: Excel.CultureInfo;
Property Value
Remarks
[Api set: ExcelApi 1.11]
decimalSeparator
Gets the string used as the decimal separator for numeric values. This is based on the local Excel settings.
readonly decimalSeparator: string;
Property Value
string
Remarks
[Api set: ExcelApi 1.11]
iterativeCalculation
Returns the iterative calculation settings. In Excel on Windows and Mac, the settings will apply to the Excel Application. In Excel on the web and other platforms, the settings will apply to the active workbook.
readonly iterativeCalculation: Excel.IterativeCalculation;
Property Value
Remarks
[Api set: ExcelApi 1.9]
thousandsSeparator
Gets the string used to separate groups of digits to the left of the decimal for numeric values. This is based on the local Excel settings.
readonly thousandsSeparator: string;
Property Value
string
Remarks
[Api set: ExcelApi 1.11]
useSystemSeparators
Specifies if the system separators of Excel are enabled. System separators include the decimal separator and thousands separator.
readonly useSystemSeparators: boolean;
Property Value
boolean
Remarks
[Api set: ExcelApi 1.11]
Method Details
calculate(calculationType)
Recalculate all currently opened workbooks in Excel.
calculate(calculationType: Excel.CalculationType): void;
Parameters
- calculationType
- Excel.CalculationType
Specifies the calculation type to use. See Excel.CalculationType for details.
Returns
void
Remarks
[Api set: ExcelApi 1.1]
calculate(calculationType)
Recalculate all currently opened workbooks in Excel.
calculate(calculationType: "Recalculate" | "Full" | "FullRebuild"): void;
Parameters
- calculationType
-
"Recalculate" | "Full" | "FullRebuild"
Specifies the calculation type to use. See Excel.CalculationType for details.
Returns
void
Remarks
[Api set: ExcelApi 1.1]
load(options)
Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.
load(options?: Excel.Interfaces.ApplicationLoadOptions): Excel.Application;
Parameters
Provides options for which properties of the object to load.
Returns
load(propertyNames)
Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.
load(propertyNames?: string | string[]): Excel.Application;
Parameters
- propertyNames
-
string | string[]
A comma-delimited string or an array of strings that specify the properties to load.
Returns
load(propertyNamesAndPaths)
Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): Excel.Application;
Parameters
- propertyNamesAndPaths
-
{ select?: string; expand?: string; }
propertyNamesAndPaths.select is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand is a comma-delimited string that specifies the navigation properties to load.
Returns
set(properties, options)
Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type.
set(properties: Interfaces.ApplicationUpdateData, options?: OfficeExtension.UpdateOptions): void;
Parameters
- properties
- Excel.Interfaces.ApplicationUpdateData
A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called.
- options
- OfficeExtension.UpdateOptions
Provides an option to suppress errors if the properties object tries to set any read-only properties.
Returns
void
set(properties)
Sets multiple properties on the object at the same time, based on an existing loaded object.
set(properties: Excel.Application): void;
Parameters
- properties
- Excel.Application
Returns
void
suspendApiCalculationUntilNextSync()
Suspends calculation until the next context.sync() is called. Once set, it is the developer's responsibility to re-calc the workbook, to ensure that any dependencies are propagated.
suspendApiCalculationUntilNextSync(): void;
Returns
void
Remarks
[Api set: ExcelApi 1.6]
suspendScreenUpdatingUntilNextSync()
Suspends screen updating until the next context.sync() is called.
Note*: Don't call suspendScreenUpdatingUntilNextSync repeatedly (such as in a loop). Repeated calls will cause the Excel window to flicker.
suspendScreenUpdatingUntilNextSync(): void;
Returns
void
Remarks
[Api set: ExcelApi 1.9]
toJSON()
Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original Excel.Application object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.ApplicationData) that contains shallow copies of any loaded child properties from the original object.
toJSON(): Excel.Interfaces.ApplicationData;