1

将 Attachmate Reflections Standard Suite 2011 R2 使用 excel 用于源数据集。我尝试自动化的终端需要 F9 键来提交信息,但是当我尝试发送该键时,我收到“字典中不存在给定键”错误。我尝试发送到终端应用程序的所有其他键似乎都可以正常工作。下面是一个代码片段:

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

我有点不知所措,因为反射 API 文档显示使用 ControlKeyCode_F9 作为功能键,但代码抛出错误。

任何帮助都会得到帮助。

4

1 回答 1

1

因此,即使通过 Google,似乎也很少有关于 Attachemate Reflections 的信息。此处也缺少反馈也证实了这一点,但我想更新此信息,以防将来其他任何人遇到类似的令人沮丧的经历。

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 存在冲突。当两者都启用时,功能键和其他 Attachmate 内置功能根本不起作用。通过浏览对象浏览器并注意到明显的差异,我在多次敲击键盘后偶然发现了错误。

无论如何,我意识到很少有人可能仍在使用 Attachmate,但对于那些被公司束缚在此应用程序中的可怜的流浪汉,也许这会有所帮助

谢谢,

于 2014-04-10T17:33:55.037 回答