LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 10
Default Deleting PivotFields from a PivotChart in VB.NET

Hi,
I keep getting an Exception from HRESULT: 0x800A03EC when trying to delete
unneeded PivotFields from my PivotChart. The code I am using is below. Any
thoughts as to why I get an Exception? Any advice on how I can get this to
work?
Thanks.

Dim field As String
Dim pivFields As Excel.PivotFields =
CType(CType(xlWs2.PivotTables("PivotTable1"), Excel.PivotTable).PivotFields,
Excel.PivotFields)

For Each pivField As Excel.PivotField In pivFields
field = pivField.Name
If field < "Serial Number" And field < PivotData And field < PivotRow
And field < PivotColumn And Not lstXGrouping.Items.Contains(field) And Not
lstSeriesGrouping.Items.Contains(field) Then

For Each pivItem As Excel.PivotItem In pivField.PivotItems
pivItem.Delete()
Next
End If
Next
 
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
2 y-axes PivotChart geoffz Charts and Charting in Excel 1 August 22nd 06 06:04 PM
Where does Excel store the orientation of PivotFields? Valentin Charts and Charting in Excel 0 April 3rd 06 04:02 PM
PivotChart Dominic Excel Discussion (Misc queries) 3 March 20th 06 05:38 PM
Sort PivotChart alexhatzisavas Excel Discussion (Misc queries) 0 September 22nd 05 06:42 AM
pivotchart Shin Charts and Charting in Excel 1 June 20th 05 01:01 AM


All times are GMT +1. The time now is 04:08 AM.

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

About Us

"It's about Microsoft Excel"