Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create CubeFields with C#

Hello all,

I am been trying to figure this out and I failed. I am using VS 2008, and
Office 2007.

I ran a Macro to add a field from SSAS Cube, and I am trying to convert it
to code in C# but I failed.

The code that is generated by the macro is:

With ActiveSheet.PivotTables("PivotTable1").CubeFields( _
"[Account].[All Members]")
.Orientation = xlRowField
.Position = 1
End With

The problem I am runing in is I have a variable that is my pivottable, when
I try to type pt.CubeFields I only get the options to AddSet which I also
have not figure it out.

What I am trying to do is based on the user selection create the pivottable
for them.

Any help you provide is greatly apprecited.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create CubeFields with C#

That is how I got it to work, just in case someone else is looking for this.

Excel.CubeField cf = null;

cf = pt.CubeFields["[Account].[All Members]"];
cf.Orientation =
Microsoft.Office.Interop.Excel.XlPivotFieldOrienta tion.xlRowField;
cf.Position = 1;


"Bishman" wrote:

Hello all,

I am been trying to figure this out and I failed. I am using VS 2008, and
Office 2007.

I ran a Macro to add a field from SSAS Cube, and I am trying to convert it
to code in C# but I failed.

The code that is generated by the macro is:

With ActiveSheet.PivotTables("PivotTable1").CubeFields( _
"[Account].[All Members]")
.Orientation = xlRowField
.Position = 1
End With

The problem I am runing in is I have a variable that is my pivottable, when
I try to type pt.CubeFields I only get the options to AddSet which I also
have not figure it out.

What I am trying to do is based on the user selection create the pivottable
for them.

Any help you provide is greatly apprecited.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
create Macro €“ select data, sort by acc no., yr, part no, create P Johnny Excel Programming 0 November 22nd 06 03:18 PM
How to create adress list so can mail merge and create labels? adecocq Excel Discussion (Misc queries) 2 October 25th 06 12:32 AM
Create dictionary of terms, create first time user site Solitaire Jane Austin New Users to Excel 1 January 19th 06 09:47 PM
CubeFields Tony Excel Programming 0 October 13th 05 03:21 PM


All times are GMT +1. The time now is 06:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"