Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel code for dynamic linking from Extra?

Status
Not open for further replies.

Chotor

Technical User
Oct 2, 2008
20
0
0
NO
Hi

I need to display some values from Extra in Excel (for calculation reasons).

I've tried to copy-paste a small area, and end up with this code:
='EXTRA!.Session.1'|'\\SERVER001N\MYUSER8$\E!PC\SESSIONS\MY-SESSION.EDP'!\R7C9R7C14M1

Why is this not working? Is there some other code to use?
I'd rather avoid having a continuous macro in Excel running. I'd just like the link.
 
Hi,

"...a continuous macro in Excel running..."

How is that?

You can write a function in Excel VBA, that can scrape your Extra screen and return a value. Is that not what you want?

Here's an example...
Code:
Function OrderQtyLocEXA(sPN As String) As String
'---------------------------------------------------------------
    Dim sys2 As Object, sess2 As Object, sf412431 As Object
    Dim oDetail As Object
    
    Set sys2 = CreateObject("Extra.System")
    Set sess2 = sys2.activesession
    Set sf412431 = sess2.SCREEN
    
    With sf412431
        .SendKeys ("<CLEAR>")
        .MoveRelative 1, 1, 1
        .SendKeys ("<enter>")
        Do Until (.WaitForCursor(8, 1))
            DoEvents
        Loop
        .Area(8, 1, 8, 15).Value = "sf412431"
        .MoveRelative 1, 1, 1
        .SendKeys ("<enter>")
        Do Until (.WaitForCursor(3, 17))
            DoEvents
        Loop
    
        With .Area(3, 17, 3, 32)
            .Value = "                 "
            .Value = sPN
        End With
NXTPAGE:
        .moveto 3, 17
        .MoveRelative 1, 1, 1
        .SendKeys ("<enter>")
REENTER:
        Do Until (.WaitForCursor(3, 17))
            DoEvents
        Loop
    
GetData:
        Set oDetail = .Area(1, 1, 24, 80)
        
        OrderQtyLocEXA = Mid(oDetail, 1, 9)
        
    End With
        
    Set sys2 = Nothing
    Set sess2 = Nothing
    Set sf412431 = Nothing
        
End Function


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip, thanks for answering and taking the time to write that code.

I'm really only looking for a link in Excel.
The thing is, the values in Extra will change randomly, and I don't want to run a macro every now and then.
I'm monitoring 7-8 lines in Extra.

I want Excel to update in real time.

This used to work with KEA! (also from Attachmate).
 



If you can find a dde link, I'd like to know.

My users use this for dynamically changing data. They just hit F9, to refresh the formulas whenever they want fresh data.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Cheers.
What I did was to copy a small part of the screen (just one number) and paste it in one Excel cell. This creates a link with the code as the first post. It's working now (I had forgotten to restart my sheet).

The numbers now update in real-time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top