Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default PivotTable PageFields c# / api changes from Excel 2003 to Excel 20

I m trying to access the page fields of an Excel 2007 pivot table with a VSTO
addin written in c#

I m having the Exception ("Exception from HRESULT: 0x800A03EC") when I try
to display the CurrentPageName, here is the snippet code I m using:

<code
try
{
Excel.PivotFields pFields =
(Excel.PivotFields)cell.PivotTable.get_PageFields( System.Reflection.Missing.Value);

int count = pFields.Count;
for (int i = 1; i <= count; i++)
{
Excel.PivotField pf =
(Excel.PivotField)cell.PivotTable.get_PageFields(( object)i);
String s = pf.CurrentPageName;
MessageBox.Show(s);
}
}
catch(Exception e)
{

}
</code

I m having an issue with Excel 2007, however evrything is ok when I run this
for Excel 2003.

did the api of the pivot table changed from 2003 to 2007 ?

did someone succeeded in getting the page fields froma pivot table in excel
2007 ?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default PivotTable PageFields c# / api changes from Excel 2003 to Excel20

Excel 2007 PivotTable
List Page Field headers and items selected.
VBA macro
http://www.mediafire.com/file/dyojfoyiqzo/09_23_09.xlsm
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default PivotTable PageFields c# / api changes from Excel 2003 to Exce



"Herbert Seidenberg" wrote:

Excel 2007 PivotTable
List Page Field headers and items selected.
VBA macro
http://www.mediafire.com/file/dyojfoyiqzo/09_23_09.xlsm


thnx for the answer Herbert but the issue is not with VB nor VBA
isssue I m having is with c# and Excel 2007 with VSTO addin

Regards,

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default PivotTable PageFields c# / api changes from Excel 2003 to Excel 20

Use pf.CurrentPage instead of pf.CurrentPageName. You may also write Convert.toString(pf.CurrentPage).

On Wednesday, September 23, 2009 8:36 AM tuxmobil wrote:


I m trying to access the page fields of an Excel 2007 pivot table with a VSTO
addin written in c#

I m having the Exception ("Exception from HRESULT: 0x800A03EC") when I try
to display the CurrentPageName, here is the snippet code I m using:

<code
try
{
Excel.PivotFields pFields =
(Excel.PivotFields)cell.PivotTable.get_PageFields( System.Reflection.Missing.Value);

int count = pFields.Count;
for (int i = 1; i <= count; i++)
{
Excel.PivotField pf =
(Excel.PivotField)cell.PivotTable.get_PageFields(( object)i);
String s = pf.CurrentPageName;
MessageBox.Show(s);
}
}
catch(Exception e)
{

}
</code

I m having an issue with Excel 2007, however evrything is ok when I run this
for Excel 2003.

did the api of the pivot table changed from 2003 to 2007 ?

did someone succeeded in getting the page fields froma pivot table in excel
2007 ?



On Thursday, September 24, 2009 4:27 AM tuxmobil wrote:


"Herbert Seidenberg" wrote:


thnx for the answer Herbert but the issue is not with VB nor VBA
isssue I m having is with c# and Excel 2007 with VSTO addin

Regards,



On Friday, September 25, 2009 2:49 PM Herbert Seidenberg wrote:


Excel 2007 PivotTable
List Page Field headers and items selected.
VBA macro
http://www.mediafire.com/file/dyojfoyiqzo/09_23_09.xlsm




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default PivotTable PageFields c# / api changes from Excel 2003 to Excel 20

Use Convert.ToString(pf.CurrentPage) instead of pf.CurrentPageName.

On Wednesday, September 23, 2009 8:36 AM tuxmobil wrote:


I m trying to access the page fields of an Excel 2007 pivot table with a VSTO
addin written in c#

I m having the Exception ("Exception from HRESULT: 0x800A03EC") when I try
to display the CurrentPageName, here is the snippet code I m using:

<code
try
{
Excel.PivotFields pFields =
(Excel.PivotFields)cell.PivotTable.get_PageFields( System.Reflection.Missing.Value);

int count = pFields.Count;
for (int i = 1; i <= count; i++)
{
Excel.PivotField pf =
(Excel.PivotField)cell.PivotTable.get_PageFields(( object)i);
String s = pf.CurrentPageName;
MessageBox.Show(s);
}
}
catch(Exception e)
{

}
</code

I m having an issue with Excel 2007, however evrything is ok when I run this
for Excel 2003.

did the api of the pivot table changed from 2003 to 2007 ?

did someone succeeded in getting the page fields froma pivot table in excel
2007 ?



On Thursday, September 24, 2009 4:27 AM tuxmobil wrote:


"Herbert Seidenberg" wrote:


thnx for the answer Herbert but the issue is not with VB nor VBA
isssue I m having is with c# and Excel 2007 with VSTO addin

Regards,



On Friday, September 25, 2009 2:49 PM Herbert Seidenberg wrote:


Excel 2007 PivotTable
List Page Field headers and items selected.
VBA macro
http://www.mediafire.com/file/dyojfoyiqzo/09_23_09.xlsm



On Friday, June 22, 2012 9:08 AM Sandeep Jain wrote:


Use pf.CurrentPage instead of pf.CurrentPageName. You may also write Convert.toString(pf.CurrentPage).




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
2007 / 2003 Pivottable Macro jxbeeman Excel Discussion (Misc queries) 0 July 21st 09 08:51 PM
error 1004 when setting pivottable.pagefields Amedee Van Gasse Excel Discussion (Misc queries) 0 September 24th 08 01:39 PM
problem with pivotTable in Excel [email protected] Excel Discussion (Misc queries) 1 June 4th 08 02:36 PM
Excel 2007/2003 Pivottable compatibility Michael Anderson Excel Discussion (Misc queries) 0 February 21st 08 02:55 AM
Pivottable feature(?) in Excel 2003 SP-1 Greg Goodman Excel Discussion (Misc queries) 10 July 31st 06 01:20 PM


All times are GMT +1. The time now is 11:10 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"