bnosac/taskscheduleR

Unable to create a task from neither add-in nor script

BryanTegomoh opened this issue · 3 comments

Script runs fine normally, however when added as a scheduled task, fails to complete

Warning message: In file.create(to[okay]) : cannot create file 'Top Preprints Feb-28 to Mar-14-2023 11 26.xlsx', reason 'Permission denied'

Code used:

`
file_name <- paste0("Top Preprints ", format(Sys.Date()-14, "%b-%d"), " to ", format(Sys.time(), "%b-%d-%Y %H %M"), ".xlsx")

log_file <- "C:\Users\name\OneDrive\Desktop\Scheduled-Tasks\Rapid-Reviews-Infectious-Diseases-Script.log"

cat("Exporting output results (Generating attachment files)... \n\n")

export(top_combined_preprints, file_name, na.string = "Not available")`