Hello all,
I'm new to Attachmate thank you for your understanding.
I have an excel workbook 'test' with a sheet in cell A1 and a 'test1'
I would then copy A1 test1 and paste it on my session ETRA! Sessions
Code:
'Global variable declarations
Global g_HostSettleTime%
Global g_szPassword $
Sub Main ()
'------------------------------------------------- -------------------------------
'Get the main purpose of the system
Sun Sessions As Object
Sun System As Object
Set System = CreateObject ("EXTRA.System") '' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
'------------------------------------------------- -------------------------------
'Set the default timeout value timeout
g_HostSettleTime = 3000 'milliseconds
OldSystemTimeout = & System.TimeoutValue
If (g_HostSettleTime> OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
'Get the necessary Session Object
Sun Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
End If
If Not Then Sess0.Visible Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'------------------------------------------------- -------------------------------
'Declare the Excel object
Sun xlApp As Object, xlSheet As Object, Row As Long
Set xlApp = CreateObject ("Excel.Application")
xlApp.Application.DisplayAlerts = False 'disable the messages
xlApp.Visible = True
xlApp.Workbooks.Open Filename: = "F: \ vba \ April 04 2012.xls"
Set xlSheet = xlApp.ActiveSheet
Set myRange xlApp.ActiveSheet.Range = ("A2")
Sess0.Screen.PutString xlApp.ActiveSheet.Range ("A2"). Value, Row, Col
Sess0.Screen.SendKeys ("<Enter>")
End Sub
Thank you for all answers
I'm new to Attachmate thank you for your understanding.
I have an excel workbook 'test' with a sheet in cell A1 and a 'test1'
I would then copy A1 test1 and paste it on my session ETRA! Sessions
Code:
'Global variable declarations
Global g_HostSettleTime%
Global g_szPassword $
Sub Main ()
'------------------------------------------------- -------------------------------
'Get the main purpose of the system
Sun Sessions As Object
Sun System As Object
Set System = CreateObject ("EXTRA.System") '' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
'------------------------------------------------- -------------------------------
'Set the default timeout value timeout
g_HostSettleTime = 3000 'milliseconds
OldSystemTimeout = & System.TimeoutValue
If (g_HostSettleTime> OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
'Get the necessary Session Object
Sun Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
End If
If Not Then Sess0.Visible Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'------------------------------------------------- -------------------------------
'Declare the Excel object
Sun xlApp As Object, xlSheet As Object, Row As Long
Set xlApp = CreateObject ("Excel.Application")
xlApp.Application.DisplayAlerts = False 'disable the messages
xlApp.Visible = True
xlApp.Workbooks.Open Filename: = "F: \ vba \ April 04 2012.xls"
Set xlSheet = xlApp.ActiveSheet
Set myRange xlApp.ActiveSheet.Range = ("A2")
Sess0.Screen.PutString xlApp.ActiveSheet.Range ("A2"). Value, Row, Col
Sess0.Screen.SendKeys ("<Enter>")
End Sub
Thank you for all answers