I built a script that pulls from the data warehouse and cleans the data in a format to be export as a csv file. I take the file and paste it into an Excel file that already has a PivotTable with slicers on another tab. The thing is that I am creating a report for every sales rep with their own sales using an Excel macro. There are 300 sales reps that I am sending this unique report to. Right now, I use an Excel VBA macro that creates individual reports and sends them to each sales rep via Outlook which takes a very long time and slows down my laptop.
Is there a way to use R to auto update an Excel file for each sales rep data and refreshes the PivotTable without having to open them individually? I also want to send an automated email which attaches the Excel file and sends to each sales rep via Outlook. I have done it for text and csv files via R but not in a loop manner to over 100 sales rep.