0

I'm trying to run an automated script using Rstudio add-in TaskscheduleR everyday. Then saving that to an appended excel spreadsheet with today's date.

But I get the below error each time. I can get the writexlsx2 to work if I name the sheetname="abc", but not if I try to name it today's date. That way the I know what date the scheduler excel output ran. Any ideas how to label the Excel tab today's date when TaskscheduleR runs?

 currentDate <- Sys.Date()
write.xlsx2(mydata, "mydata with Clicklist.xlsx", sheetName=currentDate, col.names = TRUE, row.names =TRUE, append=TRUE)

Error in .jcall(wb, "Lorg/apache/poi/ss/usermodel/Sheet;", "createSheet",  : 

method createSheet with signature (D)Lorg/apache/poi/ss/usermodel/Sheet; not found

TylerH
  • 20,799
  • 66
  • 75
  • 101
NR_DTW987
  • 43
  • 1
  • 4

1 Answers1

0

I'm guessing you just need to convert currentDate into a string. as.character(currentDate) will probably do it.

Simon Woodward
  • 1,946
  • 1
  • 16
  • 24