Skip to content
Prev 302805 / 398503 Next

Saving Splitted Series to Excel via XLConnect

Hello,

First of all, apologies to Henrique, he'll receive th same answer twice, 
but I forgot to Cc the list.

In order to write 3 worksheets you need to create 3 worksheets. What 
happened is that you were overwriting the previous sheets and ended up 
just with the last one. So adopt a different method: lapply().


wb <- loadWorkbook("Teste.xlsx", create = TRUE)

series <- seq_along(dados2)
sheet <- paste0("Teste", series)
lapply(series, function(i){
     createSheet(wb, name = sheet[i])
     writeWorksheet(wb, dados2[[i]], sheet = sheet[i])})

saveWorkbook(wb)

This worked with me.

Hope this helps,

Rui Barradas
Em 08-08-2012 21:10, Henrique Andrade escreveu: