how to copy ExcelWorkSheet from template with new CodeModule
I am having an issue with copying a ExcelWorkSheet and the corresponding CodeModule of the copied sheet. Let me explain: Scenario: I have an excel file with macro's (.xlsm) and I use this excel file as a template to create an other excel file (data will be copied into the new file). So, first I fetch some data from a database and open the excel template ( .xlsm ) file. At a certain point, some entries need to be in different worksheets, this is where the 'WorkSheets.Add()' comes in. var newSheet = workbook.Worksheets.Add("someName", templateSheet); After copying the template sheet (which