Are the templates all the same? Because then you could write a logic as follows:
- Retrieve Template (with sheet = 1)
- Run template on the excel file
- Changed template (sheet = 2)
- Run template on the excel file
- rinse and repeat, at the end set your template to sheet = 1