Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PivotTable - PivotFields VBA | Excel Discussion (Misc queries) | |||
Deleting PivotFields from a PivotChart in VB.NET | Charts and Charting in Excel | |||
PivotFields problem | Excel Programming | |||
PivotFields | Excel Programming | |||
Pivotfields.CurrentPage | Excel Programming |