Copy macro in a template file with Apache POI?
===

My problem:

I have two workbooks. 

Workbook1: constructed from a template file with macro

Workbook2: empty

In a loop I export my datastructures. In each loop passing I copy the template to wokrbook2 and then write the data in it, mark the row where I was for the next loop passing, and then do the same again.

At the end I have copied the template multiple times ( as many times as I have datasets) to the workbook2 and written data in the according template.

My problem: There is a macro in the original template file which is gone when I open my newly created file. All the data is correctly written, just the macro functionality is missing.