title: openxlsx not able to read from .xlsx file in R
body: <p>I am trying to read value from a <code>.xlsx</code> file using <code>openxlsx</code> package in <code>R</code>. In simple words,  I need to write a row of data, which then populates some output cell that has to be read back in R. I will share an example to better explain the problem.</p>
  
  <p>Initial state of the <code>.xlsx</code> file:</p>
  
  <p><a href="https://i.stack.imgur.com/YYLfR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYLfR.png" alt="enter image description here"></a></p>
  
  <p>I'm now trying to write new values to the cell : A2:A3 = c("c", 5). So ideally, I'm expecting <code>A6 = 15</code></p>
  
  <p>Below is the code used :</p>
  
  <pre><code>require(openxlsx)
  path &lt;- "C:/path_to_file/for_SO1.xlsx"
  input_row &lt;- c("c", 5)
  # Load workbook; create if not existing
  wb &lt;- loadWorkbook(path)
  # createSheet(wb, name = "1")
  writeData(wb, 
            sheet = "Sheet1",
            x = data.frame(input_row),
            startCol=1,
            startRow=1
  )  
  
  data_IM &lt;- read.xlsx(wb, 
                       sheet = "Sheet1",
                       rows = c(5,6),
                       cols = c(1))
  # Save workbook
  saveWorkbook(wb, file = path, overwrite = TRUE)
  
  #&gt; data_IM
  #  output_row
  #1          3
  </code></pre>
  
  <p>But I get the inital value(3). However, If i open the <code>.xlsx</code> file, I can see the <code>15</code> residing there:</p>
  
  <p><a href="https://i.stack.imgur.com/jHc3u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jHc3u.png" alt="enter image description here"></a></p>
  
  <p>What could be the reason for not able to read this cell? I tried saving it after writing to the file and again reading it but even that failed. <code>openxlsx</code> is the only option I have due to JAVA errors from XLConnect etc.</p>