R/exportFct_trySave.R

Defines functions exportFct_trySave

exportFct_trySave <- function(wb, file){
  tryCatch({
    saveWorkbook(wb, file=file, overwrite=TRUE)
    message("File created successfully!\n")
  },
  error = function(err){
    message("\nCaution! Excel spreasheet could not be produced correctly due to the following error:")
    message(err)
    message(paste("\n\nAlthough the Excel output failed, you can still access the results of the analysis via its return value or as an R object in the results folder.\n"))
  })
  return(TRUE)
}
DoroChilds/TPP documentation built on Oct. 31, 2021, 4:38 a.m.