Excel/Extra help

Chris25

New Member
Joined
May 15, 2009
Messages
1
Hi guys,

I'm looking for some help with my code below, basically I'm extracting data from specific columns in Extra and pasting back into Excel.

I'm running the code from Excel, I have gotten as far as "getstring" but it doesn't seem to want to copy the data. I've looked around and tried to put together some code, but not at work today so I can't test it.

Any input would be greatly appreciated.

After the system has copied data, I need it pasted back into the active workbook where the macro is running, but I haven't got as far as working the code out for that yet.

Thanks guys.

'--------------------------------------------------------------------------------
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
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 = 30 ' 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)

' This section of code contains the recorded events
ORDERNUMBER = Application.InputBox("PO Number")
Sess0.screen.SendKeys ("6<Enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)

Sess0.screen.SendKeys (ORDERNUMBER)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Sess0.screen.SendKeys ("<enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
aa18 = Sess0.screen.MoveTo(11, 10)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)

Dim A1(), B1() As String
Dim count As Integer
'gets your variables and stores in an array
Do
count = count + 1
ReDim Preserve A1(count)
ReDim Preserve B1(count)
A1(count) = Sess2.screen.GETstring(?, ?, ?)
B1(count) = Sess2.screen.GETstring(?, ?, ?)
Sess2.screen.SendKeys ("<F8>")
Sess2.screen.WaitHostQuiet (1000)
Loop While Sess2.screen.GETstring(where?,where?,16)<>"Foward Completed"
'add coords to the above where "where is"

For count = 1 To count
Sess2.screen.putstring A1(count), ?, ?
Sess2.screen.putstring B1(count), ?, ?
Sess2.screen.WaitHostQuiet (1000)
Next



End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,276
Messages
6,171,138
Members
452,381
Latest member
Nova88

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