I am unsure what you are trying to export if you are exporting a data view to excel as that typically holds only 1 object. But your error states that your Template is empty:
Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException: TemplateObject cannot be empty.
Can you debug the flows it and check if you retrieve a MxTemplate object or if it is empty?