I'm generating a csv file from a database using a web application developed in PHP. I've created a batch file to copy the csv file from the server directory to another server upon generation. I have also created macros to save it as an xlsx file, format the table and perform calculations on the data. All of this does not need to happen every time the file is open, just when it is exported.
I would like to work these macros into the batch file so that all of this happens automatically upon generation, rather than generation, copying to the appropriate folder then having to open it and manually executing the macros.
What I'm thinking my order of operations will be are:
Generate csv file
Convert to xlsx with macro
Use macros to format and perform calculations
Copy xlsx file to appropriate folder on another drive
Delete xlsx file on the server the web application is on
I'm having trouble figuring out if I can or how to export the excel macros and use them as standalone files to be used by the batch file. Is what I'm wanting to do possible? Am I approaching this from a wrong direction? Any help, even just a, "Hey look into this," would be greatly appreciated.