2/28/2018 7:06 AM | |
Joined: 2/11/2018 Last visit: 8/8/2024 Posts: 18 Rating: (0) |
Hello magicmoose, I tried as per your suggestion, but still not working. Here is my script below: Option Explicit Function action Dim WScriptShell Set WScriptShell = CreateObject("WScript.Shell.1") Dim objControl Set objControl = HMIRuntime.Screens("basescreen.picturewidow:Main.pdl").ScreenItems("Control1") objControl.Activate 'WScriptShell.SendKeys "{F9}" WScriptShell.SendKeys "{F8}" End Function I am getting error as shown in attached. Also, you can find my demo backup here. https://we.tl/Vi6IUp6s73 Kindly help me. |
2/28/2018 2:58 PM | |
Posts: 27 Rating: (3) |
Try this: Option Explicit Function action Dim WScriptShell Set WScriptShell = CreateObject("WScript.Shell.1") Dim objControl Set objControl = HMIRuntime.Screens("main").ScreenItems("Control1") objControl.ScreenName = "main" 'WScriptShell.SendKeys "{F9}" WScriptShell.SendKeys "{F8}" End Function Note that you do not want to include the ".pdl" when referencing a screen name. If that doesn't work please tell me if main is the only screen or is it a screen on another screen?
|
3/1/2018 6:19 PM | |
Posts: 27 Rating: (3) |
Ok, I'm not sure that objControl.ScreenName = "main" is valid, I found it in another example. You may want to look here: How do you export and reimport WinCC Runtime data? And also here: Automatic Export with VBScript - WinCC 6.2 They are two different methods of doing what you are trying to do. Chris
|
Last edited by: magicmoose at: 3/1/2018 6:20:59 PMLast edited by: Jen_Moderator at: 3/2/2018 6:50:32 AMOptimized link. |
|
Follow us on