expression.Wait( _ ByVal waitTime As Integer _ )
where expression is a variable that represents a ApplicationObject Object
Parameters
- waitTime
- Wait time (in milliseconds).
expression.Wait( _ ByVal waitTime As Integer _ )
This Microsoft Excel VBA sample shows how to use the Wait method to make sure InfoConnect has initialized when you open it from another application. It opens InfoConnect and creates a demo session. To run this sample:
On the Excel VBA Editor Tools menu, select References and then select the following InfoConnect Libraries:
Then copy the following code into an Excel Sheet object code window and press F5 to run the macro.
Public Sub OpenASessionFromMSExcel() 'Declare an object variable for the InfoConnect object Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject 'Declare additional InfoConnect objects, such as frame, terminal, and view Dim frame As Attachmate_Reflection_Objects.frame Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal Dim view As Attachmate_Reflection_Objects.view 'Create a new instance of InfoConnect Set app = New Attachmate_Reflection_Objects_Framework.ApplicationObject 'wait until InfoConnect initializes Do While app.IsInitialized = False app.Wait (200) Loop 'Create controls to open and display the session document. Set frame = app.GetObject("Frame") frame.Visible = True Set terminal = app.CreateControl2("09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1") terminal.HostAddress = "demo:ibm3270.sim" Set view = frame.CreateView(terminal) Set screen = terminal.screen End Sub