0

I am crating an excel file with pivot table and charts. When I use '&' in column name it throws error "One or more errors occurred". Error is only when creating pivot table.

var pivot1 = pivotSheetT1.PivotTables.Add(pivotSheetT1.Cells["A3"], Range, "some text");

How to handle characters like '&' ? I do not ant to remove this character, I need to show it in excel file.

codemirror
  • 3,164
  • 29
  • 42
  • Just a wild guess - can you try with "&" and see what happens ? This will use the Xml escape sequence for "&" (https://stackoverflow.com/questions/12524908/how-to-escape-in-xml) – Subbu Jul 03 '17 at 08:24
  • Replacing & with & excel is generated but corrupted excel. – codemirror Jul 03 '17 at 08:34

0 Answers0