This documentation is archived and is not being maintained.

CalculatedMembers.Add Method 

Adds a calculated field or calculated item to a PivotTable.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)

'Usage
Dim Name As String
Dim Formula As String
Dim SolveOrder As Object
Dim Type As Object
Dim returnValue As CalculatedMember
Dim calculatedMembers1 As CalculatedMembers
returnValue = calculatedMembers1.Add(Name, Formula, SolveOrder, Type)

CalculatedMember Add(
	[In] string Name, 
	[In] string Formula, 
	[In, Optional] object SolveOrder, 
	[In, Optional] object Type
);
public CalculatedMember Add(
	/*in*/System.String Name, 
	/*in*/System.String Formula, 
	/*in*/System.Object SolveOrder, 
	/*in*/System.Object Type
);
function Add(
	 Name : String, 
	 Formula : String, 
	 SolveOrder : Object, 
	 Type : Object
) : CalculatedMember;

Parameters

Name

Required String. The name of the calculated member.

Formula

Required String. The formula of the calculated member.

SolveOrder

Optional Object. The solve order for the calculated member.

Type

Optional Object. The type of calculated member.

The Formula argument must have a valid MDX (multidimensional expression) syntax statement. The Name argument has to be acceptable to the Online Analytical Processing (OLAP) provider and the Type argument has to be defined.

If you set the Type argument of this method to xlCalculatedSet, then you must call the AddSet method to make the new field set visible in the PivotTable.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Show: