0

I have an Excel with several sheets, two of which contain pivot tables based on data from other sheets ("data sheets"). Using the openxlsx package, I'm loading the Excel into R and first removing the data sheets and then creating them again with new data. This works well and the pivots update accordingly.

However, if I apply conditional formatting to the pivots and perform the above process, then I obtain an error message when opening the new updated file (We found a problem with some content in [file]. Do you want us to try to recover as much as we can? [...]). After having done the repair, I get the message:

Repaired Records: Conditional formatting from /xl/pivotTables/pivotTable1.xml part (PivotTable view)

The conditional formatting has been removed after the repair. I have found this page which might be of use to me, but I haven't got their possible solutions to work:

https://github.com/awalker89/openxlsx/issues/387

I have also tried to construct a minimal Excel reproducing this behavior, but while the minimal Excel I produce yields the We found a problem... error, it does keep the conditional formatting once repaired.

Any ideas? Thanks in advance!

SimonSimon
  • 47
  • 6
  • If we can't reproduce the error it's going to be difficult to find a solution. You could, starting from your **working** example, add step by step features/ values as in your original excel wb. Or, the other way round, remove values/features from the original wb until it works and thereby identify the source of the error. – dario Mar 03 '20 at 11:44
  • I will hopefully return with a reproducible example later this week, things are stacking up at work... – SimonSimon Mar 03 '20 at 17:18

0 Answers0