
wb <- createWorkbook()
addWorksheet(wb, "figure1")
writeData(wb, "figure1", figure1)
addWorksheet(wb, "figure2")
writeData(wb, "figure2", figure2)
addWorksheet(wb, "selected products")
writeData(wb, "selected products", product_level_data)

output_path <- file.path(path_to_output, "output.xlsx")

#Save the workbook
saveWorkbook(wb, output_path, overwrite = TRUE)
