Modify an excel

Hi I need some help with the following use case. The steps are as follows:
First Query the database. The output of the query should be loaded into an excel template. The excel template here means a pre-defined excel sheet.
In short I need to modify an existing sheet in an existing excel file.
How can we achieve this?
For example:
Query hr table → hr_results → Load “hr_results” in “hr_template.xlsx” sheet “details”

Any help will be greatly appreciated.

Check details on excel formatter here