In order to apply the VBA code from the old template after an update installation, proceed as
follows:
1. If you have already entered VBA code into the new global template, open the VBA editor
in the Graphics Designer and copy the VBA code.
2. Close WinCC.
3. Open the …\Siemens\WinCC\Templates directory in Windows Explorer.
4. Delete the new global template "@Global.pdt".
5. Rename the "@Global.sav" backup file to "@Global.pdt".
6. If you have already copied VBA code from the new global template, open the VBA editor
in the Graphics Designer and insert the copied VBA code.
The VBA code from your old global template is available again.
Project-specific VBA code (2)
Refers to VBA code that you write to the "ProjectTemplateDocument" in the VBA editor. This
VBA
code is saved in the @"PROJECT.PDT" file, which is located in the root directory of each
WinCC project.
The "@PROJECT.PDT" file has a reference to the "@GLOBAL.PDT" file. Functions and
procedures which you have saved in the "@GLOBAL.PDT" file can be called up directly in the
"ProjectTemplateDocument".
The "ProjectTemplateDocument" is where you put VBA code that you want to use in all pictures
in the open project. If you need the VBA code on a different computer, use the export and
import functions in the VBA editor.
You can open and edit the "@PROJECT.PDT" file in the same way as a PDL file. This will
allow you to use the "@PROJECT.PDT" file as a template: For example, you may create there
the basic picture of your system which will then be automatically transferred into each new
PDL file of the project. Picture properties such as layers or zoom are not copied to the PDL
file, nor is the VBA code.
Picture-specific VBA code (3)
Refers to VBA code that you write to the document "This Document" relating to the
corresponding picture in the VBA editor. This VBA code is saved as a PDL file together with
the picture.
The PDL file has a reference to the "@PROJECT.PDT" file. Functions and procedures which
you have saved in the "@PROJECT.PDT" file can be called up directly from the PDL file.
However, you do not have access to functions or procedures that are stored in the
"@GLOBAL.PDT" file.
VBA for Automated Configuration
4.2 Introduction: Using VBA in WinCC
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
1564
System Manual, 11/2008,