Friday 17 February 2017

OPEN .exe from WINCC VBS

This script is for opening .exe in Simatic Wincc projects. 

This script is common for Wincc Advanced, Wincc Professional. For Wincc 7.x the tag declaration will change


Dim sheel
Set sheel = CreateObject("wscript.Shell")
sheel.Exec "C:\Application.exe"
Set sheel = Nothing

Wednesday 26 October 2016

WINCC VBS (VBScript) to open Shortcut

This script is common for Wincc Advanced, Wincc Professional. For Wincc 7.x the tag declaration will change

Dim sheel
Dim MyFilePath
MyFilePath = "D:\Manual.lnk"
Set sheel = CreateObject("wscript.Shell")
sheel.Exec "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & MyFilePath

Wincc VBS(VBScript) to open PDF files

This script is for opening PDF file in Simatic Wincc projects. 

This script is common for Wincc Advanced, Wincc Professional. For Wincc 7.x the tag declaration will change

Dim sheel
Set sheel = CreateObject("wscript.Shell")
sheel.Exec "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" + " " + "D:\123.pdf"
Set sheel = Nothing

Wincc VBS(VBScript) for MS Access Data Report

MS Access table >> MS Access Data Report

This script is useful in generating report from MS Access table using MS Access Data Report. Here no other reporting tool(such as crystal reports) required. Softwares such as dopdf, cutepdf etc will help for printing the report in .PDF format.

This script is common for Wincc Advanced, Wincc Professional. For Wincc 7.x the tag declaration will change

Dim db
Dim rpt 
Dim ctl 
Set db = CreateObject("Access.Application")  
db.OpenCurrentDatabase "D:\DATENSRJ\Database1.mdb", True
db.Visible = True
db.DoCmd.OpenReport "Temperature_Report"
db.DoCmd.Maximize
Set rpt = Nothing
db.CloseCurrentDatabase

Wincc VBS(VBScript) for close an application(.exe)

This script is useful in closing an application(.exe) in taskmanager. This script is common for Wincc Advanced, Wincc Professional. For Wincc 7.x the tag declaration will change

Dim kei
Set kei = CreateObject("Wscript.Shell")
kei.Run "taskkill /im Datalog.exe", , True
Set kei= Nothing

Table view in Simatic Comfort HMI Sample Project - (WINCC Comfort V13 Sample project)

Click this link to get sample program. Wincc Advanced V13 SP1 is necessary to open the project.

Click here to download

The same vbscript you can use for Wincc V13 Professional 

Sunday 2 October 2016

Excel Reports between two datetime Sample Project - (WINCC Advanced V13 Sample project)

Click this link to get sample program. Wincc Advanced V13 SP1 is necessary to open the project.

Click here to download

The same vbscript you can use for Wincc V13 Professional