Applies To:
  • CitectSCADA 5.40, 5.41
  • CitectHMI 5.40, 5.41

When defining a key sequence for the SendKeys Cicode command such as CTRL + S to initiate a save in Microsoft Excel or Notepad, and the sKey is in capital letter(s) and is not enclosed in parentheses, the SendKeys command does not work properly. According to the Online Help, the examples show the sKey to be in capital letter(s), and there is no reference that it must be enclosed in parentheses. How can I get the SendKeys command to work properly? 

Citect has confirmed this to be a problem in CitectHMI/SCADA version 5.40 and 5.41. To continue with the aforementioned example, if you call the following from a button, the SendKeys command will fail to trigger the program's shortcuts, be it in Microsoft Excel, Notepad or perhaps other programs:

SendKeys("Microsoft Excel - Book1.xls", "^S") ! File is not saved
SendKeys("Microsoft Excel - Book1.xls", "^s") ! "s" is written to first cell in spreadsheet
SendKeys("Microsoft Excel - Book1.xls", "^(S)") ! File is not saved

You must call the following for SendKeys to work properly:

SendKeys("Microsoft Excel - Book1.xls", "^(s)")