VUSLICE & SUBDEFINE HELP!
Posted: Thu Aug 09, 2012 3:39 pm
Hi All,
I am trying to get the VUSLICE macro with the SUBDEFINE macro to run through all the cost centres I have in the cost centre element and from that creat files.
The problem I am having is that I can not get the subdefine to work. The vuslice always returns the same view that I have it stored as in the cube. It does not update and run through the costs centres.
Code so far:
Sub Attempt1()
iNumCentres = Run("SUBSIZ", "tm1serv:CostCentres", "SingleCC")
For Element_Index = 1 To iNumCentres
Run "M_CLEAR"
tm1CostCentre = Run("SUBNM", "tm1serv:CostCentres", "SingleCC", Element_Index)
Sheets("VUSLICE").Select
ActiveSheet.Cells.Select
Selection.Clear
Range("A1").Select
Range("A1").Value = tm1CostCentre
Run "Subdefine", "tm1serv:CostCentres", "SingleCC", Range("A1")
Run "VUSLICE", "tm1serv:Budget_Detail", "BudgetTemplate"
Next Element_Index
End Sub
All views are public, "SingleCC" is a view in the CostCentre subset of the Budget_Detail cube and "BudgetTemplate" is a view in the Budget_Detail cube.
I am totally new to this, and may have used the wrong words to describe what I am trying to get to. So any help would be appreciated, or any questions to help clarify my mumbo jumbo!
Thanks,
T
I am trying to get the VUSLICE macro with the SUBDEFINE macro to run through all the cost centres I have in the cost centre element and from that creat files.
The problem I am having is that I can not get the subdefine to work. The vuslice always returns the same view that I have it stored as in the cube. It does not update and run through the costs centres.
Code so far:
Sub Attempt1()
iNumCentres = Run("SUBSIZ", "tm1serv:CostCentres", "SingleCC")
For Element_Index = 1 To iNumCentres
Run "M_CLEAR"
tm1CostCentre = Run("SUBNM", "tm1serv:CostCentres", "SingleCC", Element_Index)
Sheets("VUSLICE").Select
ActiveSheet.Cells.Select
Selection.Clear
Range("A1").Select
Range("A1").Value = tm1CostCentre
Run "Subdefine", "tm1serv:CostCentres", "SingleCC", Range("A1")
Run "VUSLICE", "tm1serv:Budget_Detail", "BudgetTemplate"
Next Element_Index
End Sub
All views are public, "SingleCC" is a view in the CostCentre subset of the Budget_Detail cube and "BudgetTemplate" is a view in the Budget_Detail cube.
I am totally new to this, and may have used the wrong words to describe what I am trying to get to. So any help would be appreciated, or any questions to help clarify my mumbo jumbo!
Thanks,
T