Pivottable.Add doesn't work when column name is double digit


The following works:
int index = pivotTables.Add("=ReportData!A1:P128", "B3", "FTFTable");


but the following throws a "The PivotTable field name is invalid." error
int index = pivotTables.Add("=ReportData!A1:AS128", "B3", "FTFTable");


There is data in the range A1:A128. What is the issue?

Hi,


Thanks for providing us sample code snippet.

Could you provide us your template file (source data file for PivotTable), we will check it soon.

Thank you.

Hello Sahi


I’ve sorted this out, this error is due to one data heading text missing in the source data used for creating the pivot.

Cheers

Hi,


Good to know that you have sorted it now. Feel free to write us back in case you have further comments or questions, we will be happy to assist you soon.

Thank you.