M
michael vardinghus
Hi
If I shoot this off against an 2005 cube from excel 2007 it works:
Sub UseCalculatedMember()
Dim pvtTable As PivotTable
Windows("test2000.xlsx").Activate
Set pvtTable = Worksheets("Sheet2").Range("A1").PivotTable
' Add the calculated member.
pvtTable.CalculatedMembers.Add Name:="[Measures].[test3]",
Formula:="'[Measures].[Actual Unit Cost]'", Type:=xlCalculatedMeausure
End Sub
Howerver. If I try doin the same against a 2000 analysis services cube it
fails with
run-time error 1004
application-defined or object-define error
I tried changing the formula to 1000 instead of certain calculated measure
and then it works. Cant excel 2007 vba create calculated measure againt
analysis services 2000 cube?
If I shoot this off against an 2005 cube from excel 2007 it works:
Sub UseCalculatedMember()
Dim pvtTable As PivotTable
Windows("test2000.xlsx").Activate
Set pvtTable = Worksheets("Sheet2").Range("A1").PivotTable
' Add the calculated member.
pvtTable.CalculatedMembers.Add Name:="[Measures].[test3]",
Formula:="'[Measures].[Actual Unit Cost]'", Type:=xlCalculatedMeausure
End Sub
Howerver. If I try doin the same against a 2000 analysis services cube it
fails with
run-time error 1004
application-defined or object-define error
I tried changing the formula to 1000 instead of certain calculated measure
and then it works. Cant excel 2007 vba create calculated measure againt
analysis services 2000 cube?