Excel and Extra attachmate ?

djfa94

New Member
Joined
Feb 21, 2011
Messages
5
Hi, i want to cpature the texte : IWANT THIS on a sheet on excel. This is only an exemple can you hemp me ? thx

 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Have you tried to find out what objects and methods exist for Attachmate?
 
Upvote 0
Yes you can help me ?
... and what have you found? I do not have Attachmate, and so cannot look at the help or explore objects or experiment. I'm trying to say that the answer is in Attachmate commands not native Excel VBA ... although you use VBA to operate them.
 
Upvote 0
You could also investigate whether Attachmate supports DDE (Dynamic Data Exchange). If so, you may be able to use that to make the connection.
 
Upvote 0
Hi Ruddles, it uses OLE and not DDE as far as I know.
 
Upvote 0
Here is an example of code that I use to extract information from Attachmate. I hope this helps.

' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub ExtractFreight
' Get the main system object
Dim Sessions As Object
Dim I as Integer
Dim 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 wait timeout value
g_HostSettleTime = 100 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim 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 Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' Declare variables to contain the OLE objects
Dim objExcel As Object
Dim objWorkBook As Object
Dim gs as String
Dim r as Integer
Dim j as Integer
r=1

On Error Resume Next

' Attempt to get a reference to an open instance of Excel
Set objExcel = GetObject(, "Excel.Application")
If objExcel Is Nothing Then
'If GetObject failed, open a new instance of Excel
Set objExcel = CreateObject("Excel.Application")
If objExcel Is Nothing Then
MsgBox ("Could not open Excel.")
Exit Sub
End If
End If

' Make Excel visible on the screen
objExcel.Visible = True

' Create a new Workbook
Set objWorkBook = objExcel.Workbooks.Open("C:\macro\get freight fob\get freight fob.xls")

' BEFORE YOU RUN THIS YOU HAVE TO BE IN THE "MM" SCREEN WITH "VQ" IN THE FUNCTION FIELD
' Copy the result from Excel to host row 16 column 1-3
Do
result = objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value 'Gets vendor number
Sess0.Screen.PutString result, 05, 25 'Enters vendor number
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
gs = Sess0.Screen.GetString (14, 12, 15) 'Gets Freight desc
objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = gs 'Transfers freight desc to Excel
gs = Sess0.Screen.GetString (15, 47, 15) 'Gets FOB desc
objWorkBook.WorkSheets("Sheet1").Cells(r,3).Value = gs 'Transfers FOB desc to Excel
Sess0.Screen.Sendkeys("<Pf1>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
r=r+1
Loop Until objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = ""

' Excel will remain open after this Sub ends.
' To close out Excel, unremark the following 4 lines of code. .
'objWorkBook.Close
'objExcel.Quit
'set objWorkBook = Nothing
'set objExcel = Nothing
End sub
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top