Specify whether the PivotTable is compatible for Excel2003 while refreshing PivotTable

Specify whether the PivotTable is compatible for Excel2003 while refreshing PivotTable

The following sample code explains the usage of PivotTable.IsExcel2003Compatible property. The original string is 383 characters long. But when PivotTable.IsExcel2003Compatible property is set to true and pivot table is refreshed, the data of cell B5 of the pivot table is truncated and it becomes 255 characters long. However, when PivotTable.IsExcel2003Compatible property is set false and pivot table is again refreshed, the data of cell B5 of the pivot table is not truncated and remains 383 characters long. Please download the sample excel file used in this code, output excel file generated by it and its console output for your reference. Please also read the comments inside the code for better understanding of this property.

Console Output

Here is the console output of the above sample code when it is executed with the given sample excel file.

 Length of original data string: 383

Length of cell B5 after setting IsExcel2003Compatible property to True: 255

Length of cell B5 after setting IsExcel2003Compatible property to False: 383