title: Read and write excel file with comments
body: <p><strong>Q.</strong> Im looking for a way to preserve comments of an excel file after reading and manipulating.</p>
  
  <p><strong>0. My excelfile: (cant share it with you!)</strong></p>
  
  <p><a href="https://i.stack.imgur.com/OhkrI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OhkrI.png" alt="enter image description here"></a></p>
  
  <p><strong>1. I want to read it like that:</strong> (having the col comment in excel as col comment in R)</p>
  
  <p>(with whatever library that does it. openxlsx would be best)</p>
  
  <pre><code>df&lt;- data.frame(a=1:3,b=4:6,c=7:9)
  comment(df$a) &lt;- "Random comment" #is there a better practice to preserve the excel comment?
  </code></pre>
  
  <p><strong>2. Random manipulation of the data:</strong></p>
  
  <pre><code>df[2:3] &lt;- df[2:3] * 2
  df$d    &lt;- "funny"
  </code></pre>
  
  <p><strong>3. Save the data</strong> (it should look like this:)
  <a href="https://i.stack.imgur.com/6qtxs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6qtxs.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>library(openxlsx)
  
  wb &lt;- loadWorkbook("commented.xlsx")
  df &lt;- readWorkbook(wb)
  
  df[2:3] &lt;- df[2:3] * 2
  df$d    &lt;- "funny"
  df &lt;- rev(df)
  df &lt;- df[order(df$a,decreasing = T),]
  
  writeData(wb, 1, df)
  saveWorkbook(wb, "modified.xlsx")
  </code></pre>
  
  <p>A wonderful solution so far!</p>
  
  <ol>
  <li>The comments stay stationary as seen by this little example. </li>
  <li>I̶ ̶g̶e̶t̶ ̶a̶n̶ ̶a̶d̶d̶i̶t̶i̶o̶n̶a̶l̶ ̶e̶m̶p̶t̶y̶ ̶"̶c̶o̶m̶m̶e̶n̶t̶ ̶p̶o̶p̶ ̶u̶p̶ ̶w̶i̶n̶d̶o̶w̶"̶ ̶i̶n̶ ̶m̶y̶ ̶r̶e̶s̶u̶l̶t̶i̶n̶g̶ ̶f̶i̶l̶e̶.̶ ̶I̶s̶ ̶i̶t̶ ̶j̶u̶s̶t̶ ̶m̶e̶?̶  (workaround available!)</li>
  </ol>