You cannot record:
Recording a macro is an easy way to get started on a more complex macro. After you save a recorded macro, you can edit it in the Visual Basic editor to add functionality and make it easier to maintain.
If you are working with an unstructured display format (such as Open Systems terminals), you'll probably find it useful to record a macro and then look at the recorded code to get information such as the strings returned by a host or the screen positions of selected data.
Use the following best practices to carefully record your macro will help prevent problems that can occasionally occur when using a slower network connection. Typing very fast while recording or typing ahead in a session, while connected with a slow network connection can cause your macro to play back in unexpected ways. Following these best practices will lead to the best results.
Plan in advance of the recording to make sure you know the steps you will follow, which keys you will press, and which host screens are anticipated.
While recording the macro, after pressing a key to submit data to the host, wait for the next host screen to fully appear (sometimes even waiting a few extra seconds) before pressing the next keys.
If your macro doesn’t play back like you expect, delete the macro and carefully record it again using slow and deliberate steps.
If your macro is not working as expected after recording it again, manually edit the macro in the VBA editor to remove duplicate blocks of code that were created while recording. (Do not attempt to manually remove code blocks unless you have a good knowledge of the VBA programming language and syntax, as well as knowledge of the host screens being navigated.)
Recording a macro slowly and carefully does not cause the macro to run with reduced performance, as macros always run at the fastest speed possible during playback. Recording a well thought out and planned macro will lead to the best results.
This example shows how to record a macro that copies data to the clipboard. It also shows how to modify the recorded code to disconnect the session after the data is copied.
To run the macro from the editor, place the cursor in the code window and press F5.
When you record a macro, the macro recorder creates variables for two important objects (the names of the objects are unique to the terminal type):
The macro uses the ThisFrame property to get the control for the session that is selected (displayed in the workspace) during the recording. ThisFrame is a property that is available in any Reflection macro. It returns the top-level user interface component for the workspace and can be used to access the controls (sessions) running in the workspace.
For more about these objects, see Using the Reflection Object Model.