ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error# 11004, Unable to set the property error (https://www.excelbanter.com/excel-programming/311808-error-11004-unable-set-property-error.html)

Sam Santiago

Error# 11004, Unable to set the property error
 
I am programmatically generating a pivot chart. I am trying to turn off the subtotals, but attempting to set the subtotals generates an error. I have an Array of strings containing field names for the pivot chart and within the script debugger I can see that the oPivotField has a value that is a PivotField type. Even in the immediate windows accessing the subtotals property generates an error. Anyone run into this?

For Each sFieldName In aFieldList
iCounter = iCounter + 1

Set oPivotField = oPivotTable.PivotFields(sFieldName)
If Not (oPivotField Is Nothing) Then
oPivotField.Orientation = xlDataField
oPivotField.Position = iCounter
oPivotField.Subtotals(1) = False <*** Generates Error
End If
Next

Thanks,

Sam

--
_______________________________
Sam Santiago

http://www.SoftiTechture.com
_______________________________


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com