Microfocus VBA Add-On for Rumba+ Desktop. Quick Start Guide

Similar documents
Rumba 9.4. Using MSS for Centralized Management

Rumba+ Server 1.2. Readme

Rumba+ Desktop 9.5 SP1. Readme

Rumba 9.3: Certificate Express Logon. Quick Start Guide

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

Silk Test Silk Test Classic Quick Start Tutorial for Dynamic Object Recognition

OnWeb IIS Plug-in: Installation Guide

Rumba FTP Client 4.6. Readme

AccuRev Plugin for IntelliJ IDEA Installation and Release Notes

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

Caliber Visual Studio.NET Integration Visual Studio Integration

Silk Test Using the Basic Workflow with the Classic Agent

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

Silk Test Using the Basic Workflow with the Open Agent

Web-to-Host 6.9 SP1. Readme

Micro Focus Visual COBOL 4.0 Build Tools for Windows. Release Notes

ViewNow X Server Readme

Data Express 4.0. Toolkit for z/os

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

Rumba FTP Client 4.4. Setup Guide

Relativity Designer 2.2

Relativity for Windows Workstations 2.2

Micro Focus Enterprise View. Installing Enterprise View

Database Connectors Net Express/Server Express 5.1 Update 16. Release Notes

Data Express 4.0. Data Subset Extraction

AccuRev Plug-In for Visual Studio PE Installation and Release Notes

AccuRev Plug-In for Visual Studio PE Installation and Release Notes

Artix Version Release Notes: Java

ViewNow X Server Setup Guide

Database Connectors Net Express/Server Express 5.1 Update 14. Release Notes

AccuRev Plugin for Crucible Installation and Release Notes

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

Relativity Data Server

Silk Test Workbench Getting Started with Visual Tests

Relativity for Windows Workstations

Web-to-Host 6.9. Administrator Guide

Download the files from you will use these files to finish the following exercises.

Orbix CORBA Tutorial: C++

Orbix Installation Guide

Enterprise Sync 2.1. Release Notes

Relativity Data Server 2.2

Notes on using Event Manager. Last updated: November 26, 2014

Silk Test Silk Test Classic Quick Start Tutorial for Dynamic Object Recognition

Silk Performer Supplemental Tutorials

AccuRev Plug-In for Visual Studio PE Installation and Release Notes

Orbix Installation Guide

Silk Performance Manager Installation and Setup Help

Silk Central The Reporting Data Mart

Application Compatibility Guide

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG

StarTeam LDAP QuickStart Manager Administration Guide

extend Release Notes

Silk Central Release Notes

GDS provides the dll for the controllers with a simple interface, therefore development time is rapid.

Automated Sign-on for Mainframe Administrator Guide

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide

Micro Focus VisiBroker 8.5 SP5. Release Notes

SilkTest SilkTest Recorder Quick Start Tutorial

PersonPB Reference. Silk Performer 9.5. PersonPB Reference

Micro Focus Visual COBOL Development Hub R4 Update 1. Release Notes

Micro Focus The Lawn Old Bath Road Newbury, Berkshire RG14 1QN UK

VisiBroker 8.5. Installation Guide

Micro Focus Enterprise Analyzer 3.4. Installation Guide

Silk Test Testing Mobile Applications

Global Software, Inc.'s Distribution Manager User Manual. Release V12 R5 M1

Orbix Release Notes

VisiBroker Release Notes

Micro Focus VisiBroker Installation Guide

Orbix Release Notes

SAP BusinessObjects Live Office User Guide SAP BusinessObjects Business Intelligence platform 4.1 Support Package 2

HOW TO DOWNLOAD BLOOMBERG DATA INTO EXCEL

Orbix Release Notes

Artix Version Installation Guide: Java

Micro Focus Relativity DBA. Installation

VisiBroker for Visual Studio 2013

extend Release Notes

Comparing Reflection Desktop and Reflection 14

AudaIntel User Guide Version 2

outlook-vba #outlookvba

Orbix Release Notes

55193A: INTRODUCTION TO SHAREPOINT 2016 FOR COLLABORATION AND DOCUMENT MANAGEMENT

Borland StarTeam Toolbar Utility Help

Export Desktop Motion Analyzer profiles to Motion Analyzer Online: SolidWorks Motion Study Move Profile

User Guide. Kronodoc Kronodoc Oy. Intelligent methods for process improvement and project execution

SPREADSHEET (Excel 2007)

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

RingCentral for Zendesk. UK Administrator Guide

Best Practice - Programming Ribbons

A Comprehensive Look at Foxtrot s Action Library

239 Excel Keyboard Shortcuts

Classic Apps Editor Best Practices

OPTIS Labs Tutorials 2013

ZENworks Reporting System Reference. January 2017

Instruction How To Use Excel 2007 Pivot Table Example Data Source

Orbacus Version Release Notes

download instant at

Microsoft Office SharePoint. Reference Guide for Contributors

Comparing Reflection Desktop and Extra! X-treme

EXCEL CONNECT USER GUIDE

Integration to Microsoft Outlook in the Webex Meetings Desktop App

Transcription:

Microfocus VBA Add-On for Rumba+ Desktop Quick Start Guide

Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 1984-2018. All rights reserved. MICRO FOCUS, the Micro Focus logo and Rumba are trademarks or registered trademarks of Micro Focus IP Development Limited or its subsidiaries or affiliated companies in the United States, United Kingdom and other countries. All other marks are the property of their respective owners. 2018-08-14 ii

Contents About VBA Macros 4 Macro Operations..5 Working in Rumba+..6 Basic operations using RumbaEmulationSessionObject. 6 Creating a RumbaEmulationSessionObject instance..6 Connection 6 Simple navigation.. 6 Basic Operations Using RumbaApplicationObject.. 7 Opening a session.7 Getting the active session. 7 Events. 8 Persistency 9 Working with External Applications 10 Setting up your environment 10 Referencing the Rumba+ Automation Objects Library. 10 Adding RumbaGlobals and ReflectionLegacySession. 10 Examples.. 10 Launching Rumba+ and creating a session.. 11 Working with an existing instance of Rumba+..11 Enhanced capabilities using ReflectionLegacySession.. 11 Passing data from the screen to Excel.12 Contents 3

About VBA Macros Visual Basic for Applications (VBA) macros use Visual Basic to create macros. The macros have a file extension of.vb. This guide introduces you to Rumba+ Desktop VBA macros. For more information, see the Help available in the VBA Editor. Prerequisites: Rumba+ Desktop 9.5 SP1 or later Micro Focus Rumba+ Desktop VBA Add-On 4 About VBA Macros

Macro Operations In Rumba+ Desktop The three basic macro operations are described in the main Rumba+ Help. These are: Recording Editing Running In the VBA Editor There are two main Rumba interaction object types in the VBA editor: RumbaApplicationObject Used to access and handle multiple emulation sessions (Rumba+ Desktop tabs). RumbaEmulationSessionObject Used to perform emulation session related tasks such as connecting, typing, screen text retrieving, and navigation sequence execution. Macro Operations 5

Working in Rumba+ This section describes how to create VBA macros in Rumba+ Desktop. Basic operations using RumbaEmulationSessionObject RumbaEmulationSessionObject is used to access and handle multiple host session tasks such as: Connecting Typing Retrieving screen text Executing navigation sequences. For a full list of RumbaEmulationSessionObject methods, properties and events, see the VBA Editor Help. Creating a RumbaEmulationSessionObject instance 1. Open a mainframe session in Rumba+. A Session1 (Mainframe Display) object is created in the project under Rumba Objects. This object is a RumbaEmulationSessionObject, which means you can access all of its methods and properties. 2. Double-click the object. 3. Type Me.. When you press the period (. ) key, a list appears showing the available methods and properties for RumbaEmulationSessionObject. Connection This example shows how to establish a connection, setting the host name, port, then connecting: Sub SetConnection() HostName = "csimvs" Port = 2023 Connect Simple navigation After the connection is made, you can perform some navigation steps: such as setting the cursor position, typing text, sending emulation keys, and waiting for a screen to arrive: Sub NavigateToTele() WaitScreen Me, "Application:", SearchOnlyAt, False, DefaultConnectionTimeout, 3, 2, 3, 15 SetCursorPosition 25, 7 TypeText "cics" SendKey "Enter" WaitScreenTimeout Me, DefaultScreenTimeout SendKey "Clear" WaitScreenTimeout Me, DefaultScreenTimeout SendKey "Tab" 6 Working in Rumba+

TypeText "tele" SendKey "Enter" WaitScreen Me, "Account Number : ", SearchOnlyAt, False, DefaultScreenDataTimeout, 6, 26, 6, 44 Basic Operations Using RumbaApplicationObject Use RumbaApplicationObject to access and handle multiple emulation sessions (Rumba+ tabs). For a full list of RumbaApplicationObject methods, properties and events, see the VBA Editor Help. Opening a session When working in the VBA Editor launched from Rumba+, you have access to RumbaApplicationObject. For example, to open a new AS/400 session: Application.CreateSession RumbaSessionType_AS400Display or, to open a saved session profile: Application.OpenSessionProfile "C:\work\MF1.rsdm" Getting the active session Getting the active session for further work Dim RumbaActiveSession As RumbaEmulationSessionObject Set RumbaActiveSession = Application.GetSession(Application.ActiveSessionID) ' further work with the session object RumbaActiveSession.Connect Getting a session by its tab name Dim RumbaActiveSession As RumbaEmulationSessionObject Set RumbaActiveSession = Application.GetSessionByName("MF1") ' further work with the session object RumbaActiveSession.Connect Getting a session by its tab index Dim RumbaActiveSession As RumbaEmulationSessionObject Set RumbaActiveSession = Application.GetSession (2) ' further work with the session object RumbaActiveSession.Connect Working in Rumba+ 7

Events When working under the Application object, you can access RumbaApplicationObject events. Add the following code to the Application object to show a message box each time an active session opens: Private Sub RumbaApplicationObject_OnOpenSession(ByVal sessionid As Long) MsgBox "Opened" Add the following code to the Application object to show a message box each time an active session changes: Private Sub RumbaApplicationObject_OnActiveSessionChange(ByVal previousactivesessionid As Long, ByVal currentactivesessionid As Long) MsgBox "Active session changed." The events defined under the Application object are persistent. This means that the events are triggered for any instance of Rumba (even without the VBA editor being open), and also when launched from an external application such as Microsoft Excel. See Working with External Applications on page 10. More events are available using the RumbaEmulationSessionObject object. Defining the object using the WithEvents keyword provides another set of events. Dim WithEvents Emul As RumbaEmulationSessionObject The Procedure list shows the available events: The following example shows how to use the OnCursorPositionChange event to display a message box each time the cursor changes position: Private Sub Emul_OnCursorPositionChange(ByVal Row As Long, ByVal Column As Long) MsgBox "The new cursor position is: " & Row & ", " & Column The following example shows how to use the OnConnectionStateChange event to display a message box each time a successful connection is established: Private Sub Emul_OnConnectionStateChange(ByVal oldstate As RumbaAutomation.RumbaConnectionState, ByVal newstate As RumbaAutomation.RumbaConnectionState) If (newstate = RumbaConnectionState_Connected) Then MsgBox "Connection established." End If 8 Working in Rumba+

Persistency Any code written in the Session object is saved in the Rumba+ session profile. Any code written in the Application object is saved in the AppData\RumbaProject.apc file. Working in Rumba+ 9

Working with External Applications This section describes how to create VBA macros in external applications such as Microsoft Excel. Setting up your environment Referencing the Rumba+ Automation Objects Library 1. From the VBA Editor menu bar, select Tools > References. The References window appears. 2. Check Rumba Automation Objects Library from the Available References list. 3. Click OK. Adding RumbaGlobals and ReflectionLegacySession To add RumbaGlobals and ReflectionLegacySession, you must first export them from the Rumba+ VBA Editor, then import them into the Microsoft VBA Editor. 1. Open the VBA Editor from Rumba+: Select Tools > New Macro > VBA. 2. In the Project explorer, expand the Modules list, right-click RumbaGlobals and select Export File from the pop-up menu. 3. Save the file. 4. In the Project explorer, expand the Class Modules list, right-click ReflectionLegacySession and select Export File from the pop-up menu. 5. Save the file. 6. Close this instance of the VBA editor. 7. Open the VBA Editor from Excel or another Office program: Select Developer tab > Code group > Visual Basic. Note: If the Developer tab is not visible, you can enable it: 1. Select File > Options > Customize Ribbon 2. Under Customize the Ribbon and Main Tabs, check Developer. 3. Click OK. 8. In the VBA Editor, select File > Import File 9. Select RumbaGlobals.bas. 10.Click OK. 11.In the VBA Editor, select File > Import File 12.Select ReflectionLegacySession.cls. 13.Click OK. Examples 10 Working with External Applications

Launching Rumba+ and creating a session The following example launches Rumba+, creates a new mainframe session, sets some connection settings, then connects to the specified host: Sub RunRumba() Dim App As RumbaApplicationObject Dim Emul As RumbaEmulationSessionObject Dim SessID As Integer ' Create Rumba Application object: Set App = CreateObject("MicroFocus.Rumba") 'Create Mainframe Display session: SessID = App.CreateSession(RumbaSessionType_MainFrameDisplay) ' Get Emulation Session object: Set Emul = App.GetSession(SessID) ' Set connection parameters and connect: Emul.HostName = "csimvs" Emul.Port = 23 Emul.Connect Working with an existing instance of Rumba+ This example searches an existing instance of Rumba+ and, if found, obtains the emulation object: Sub UseExistingRumbaSession() Dim App As RumbaApplicationObject Dim Emul As RumbaEmulationSessionObject rumbadescriptors = RunningRumbaObjectDescriptors If Len(Join(rumbaDescriptors)) > 0 Then ' A Rumba instance was found Set App = GetObject(rumbaDescriptors(LBound(rumbaDescriptors))) Set Emul = App.GetSession(App.ActiveSessionID) ' Perform session operations using Emul End If Enhanced capabilities using ReflectionLegacySession The Micro Focus Rumba+ VBA Add-On supports a subset of the Micro Focus Reflection for IBM 14.x methods and properties. These extended methods and properties are manifested in the ReflectionLegacySession object, and provide additional emulation functionality, such as: Cursor information Screen Selection Clipboard manipulaton Field and text searching options Connection information Multiple screen wait options For details of these methods and properties, see the Reflection for IBM 14.x - Programming Reference. For more information, see the VBA Editor Help. Working with External Applications 11

This example launches Rumba+, creates a new mainframe session, sets some connection settings, then connects to the specified host. Notice how an instance of the ReflectionLegacySession object is created and used. Dim App As RumbaApplicationObject Dim Emul As RumbaEmulationSessionObject Dim ReflectionSession As ReflectionLegacySession Dim SessID As Integer Sub RunRumbaAndGetData() ' Create Rumba Application object: Set App = CreateObject("MicroFocus.Rumba") 'Create Mainframe Display session: SessID = App.CreateSession(RumbaSessionType_MainFrameDisplay) ' Get Emulation Session object: Set Emul = App.GetSession(SessID) ' Set connection parameters Emul.HostName = "csimvs" Emul.Port = 23 ' Create a Reflection legacy session object and connect Set ReflectionSession = CreateReflectionLegacySession(Emul, App) ReflectionSession.Connect Passing data from the screen to Excel The following example launches Rumba+, opens a session, connects, then reads data from the screen and sets it to a range of cells in an Excel sheet: Dim App As RumbaApplicationObject Dim Emul As RumbaEmulationSessionObject Dim ReflectionSession As ReflectionLegacySession Dim SessID As Integer Sub RunRumbaAndGetData() Set App = CreateObject("MicroFocus.Rumba") SessID = App.CreateSession(RumbaSessionType_MainFrameDisplay) Set Emul = App.GetSession(SessID) Emul.HostName = "csimvs" Emul.Port = 23 Set ReflectionSession = CreateReflectionLegacySession(Emul, App) ReflectionSession.Connect ' Get data from the emulation screen to the Excel cells ReflectionSession.WaitForDisplayString "Application", "10", 3, 2 GetData Sub GetData() Set Durations = Range("A1:A3") For i = 1 To 3 DataText = ReflectionSession.GetDisplayText(i + 4, 10, 7) Set Duration = Durations.Cells(i, 1) Duration.Value = DataText Next 12 Working with External Applications