ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error 1004 in Excel 2000 (https://www.excelbanter.com/excel-programming/295449-error-1004-excel-2000-a.html)

YaakovSinai

Error 1004 in Excel 2000
 
1.I created a Pivot table with a macro, which I activated within a VB program. The range of the table and the fields are defined by variables, so that the table can be used for different ranges and fields in the same worksheet. Part of the fields work without any problem, whereas for other fields I get the above mentioned error: "The service ADDFIELDS failed for department PIVOTTABLE".(The message is in Hebrew, maybe in English it would be phrased a little differently). The error occurs in the statement: ActiveSheet.PivotTables("PivotTable2").AddFields RowFields:=SelectedFld. Selected Fld is a variable. There is no discernable difference between the fields which work ok and the wrong ones. All are the same type in the same worksheet. How to get to the root of the problem in order to solve it or to circumvent it?


All times are GMT +1. The time now is 09:11 AM.

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