title: Using list names as names for sheets using XLConnect
body: <p>As the title suggest, I would like to do the above. Example below:</p>
  
  <pre><code>library(stringr)
  library(XLConnect)
  
  df &lt;- data.frame(do.call("rbind", lapply(1:10, function(i) rnorm(10))))
  df.list &lt;- rep(list(df), 10)
  names(df.list) &lt;- paste("DataFrame", str_pad(1:length(df.list), 2, pad = "0"), sep = "")
  
  df.list.workbook &lt;- loadWorkbook("df.list.workbook.xlsx", create = TRUE)
  lapply(1:length(df.list), function(i) createSheet(df.list.workbook, name = names(df.list[i])))
  lapply(df.list[1:length(df.list)], function(i) writeWorksheet(df.list.workbook, i, sheet = names(i)))
  </code></pre>
  
  <p>The last line is where it throws up an error:</p>
  
  <pre><code>Error: IllegalArgumentException (Java): Sheet index (-1) is out of range (0..9)
  </code></pre>
  
  <p>To troubleshoot this, I tried:</p>
  
  <pre><code>lapply(df.list[1:length(df.list)], function(i) print(names(i)))
  </code></pre>
  
  <p>And realise that the names of the columns were being passed to the sheet variable. Any ideas how to overcome this?</p>