How to create a new Template (Frame) Using C#

How to create a new Template (Frame) Using C#

Hello,
Can you please help me creating a new Template (Frame) for a Screen?
Actually I am using this code:
private Template vTemplate;
vTemplate = ZenonGLOBAL.Templates().Create("Test");
Where "ZenonGLOBAL" is the Global project in zenon. This is unfortunately not working.
But when I try to read the name of an existing template:
vTemplate = ZenonGLOBAL.Templates().Item(1);
MessageBox.Show(vTemplate.Name);
This Works without problems. Can someone tell me what I am messing?
Thanks in advance.

This is a migrated post! Originally posted on 21.07.2016 by user hamiiiz. Please be aware that information can be outdated.