Reputation: 177
the openXL function is not working in the openxlsx package. I've uninstalled then reinstalled but no luck. Oddly enough it works for the reprex below but not in any of my other scripts. Any ideas why this is? Thank you.
library(openxlsx)
setwd(getwd())
wb <- createWorkbook()
addWorksheet(wb, "test")
somedata <- "data"
writeData(wb, 1, somedata)
saveWorkbook(wb, "temp.xlsx", TRUE)
openXL(wb)
Upvotes: 1
Views: 535
Reputation: 11
On windows, this may work:
shell(shQuote(string = wb$saveWorkbook()), wait = TRUE)
It is the same command called by openXL, except for the argument wait, that is set to TRUE.
Upvotes: 1