AttachmatereflectionVBA自动化错误

使用Attachmate Reflections标准套件2011 R2使用Excel作为源数据集。 terminal我试图自动化所需的F9键提交信息,但是当我试图发送该密钥,我得到一个“给定的密钥不在字典中”错误。 我尝试发送到terminal应用程序的所有其他键似乎正常工作。 以下是一段代码片段:

sub TerminalTest() Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject Dim frame As Attachmate_Reflection_Objects.frame Set app = GetObject("Reflection Workspace") Set frame = app.GetObject("Frame") Set MGlobals.gScreen = frame.SelectedView.Control.Screen With MGlobals.gScreen .SendKeys "A" .SendKeys "123" .SendKeys "456" .SendControlKey ControlKeyCode_Return .SendKeys "780ABC" .SendControlKey ControlKeyCode_Return .SendKeys "ZYX" .SendControlKey ControlKeyCode_Return .SendKeys "TEST" .SendControlKey ControlKeyCode_Return .SendControlKey ControlKeyCode_F9 End with End sub 

我有点损失,因为reflectionAPI文档显示使用ControlKeyCode_F9function键,但它的代码是抛出一个错误。

任何帮助是appercaited。

因此,即使通过Google,Attachemate Reflections的信息也很less。 这也得到了这里缺乏反馈的证实,但是我想更新这个以防其他人在将来遇到类似的沮丧的经历。

Attachmate Reflections 2011安装4个参考文件:

 Attachmate_Reflection_Objects Attachmate_Reflection_Objects_Framework Attachmate_Reflection_Objects_Emulation_OpenSystems Attachmate_Reflection_Objects_Emulation_IbmHosts 

他们网站上的文档指示将是程序员使VBA中的所有4个引用都允许自动化。 这就是问题 – 与Attachmate_Reflection_Objects_Emulation_OpenSystems和Attachmate_Reflection_Objects_Emulation_IbmHosts似乎有冲突。 当两者都启用时,function键和其他Attachmate内置函数将无法正常工作。 通过浏览对象浏览器并注意到一个明显的区别,我偶然发现了这个错误。

无论如何,我意识到有很less人可能仍然使用Attachmate,但对于那些被他们的公司绑在这个应用程序的可怜的stream浪汉,也许这将有助于

谢谢,

Interesting Posts