Programmatically run Excel calculations
You use a similar process to run calculations in a NamedRange control or a native Excel range object.
Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Excel. For more information, see Features available by Office application and project type.
Run calculations in a NamedRange control
The following example creates a NamedRange at cell A1 and then calculates the cell. This code must be placed in a sheet class, not in the ThisWorkbook
class.
To run calculations in a NamedRange control
Create the named range.
Call the Calculate method of the specified range.
Run calculations in a native Excel range
To run calculations in a native Excel range
Create the named range.
Call the Calculate method of the specified range.
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for