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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access: Screen Scraped from EXTRA! X-treme... 1

Status
Not open for further replies.

Sosul

Technical User
Jul 2, 2007
14
US
So I hear that you guys are the experts...

I have the following code that doesn't seem to work anymore. I want it to set the current session of Extra that is open, instead it opens another session of EXTRA which isn't even the same application that I want to use.

The same of the application that is open is MCSmod4, this code will open MAINFRAME.

Any help?

Code:
Private Sub Command0_Click()

'On Error GoTo Errorhandler

' 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 = 1000     ' 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."
        Exit Sub
    End If
    If Not Sess0.Visible Then Sess0.Visible = True
    Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
 
Do you have two sessions open? Are they open with the same version and executable of Extra?
 
Nope I just have the one session open, and the Mainframe one is a different executable of Extra.
 
Just from the results it looks like you have:
One Extra open with the Mainframe session
Another Extra open with the MCSmod4 session

When you get the object, it only finds Extra with the Mainframe session. I know this might not be the most efficient way or if it'll work, but it works for getting an IE window.

Code:
Set wShell = CreateObject("Shell.Application")
For Each oWindow In wShell.Windows
     If InStr(oWindow.Name, "EXTRA") Then
         Set System = oWindow
         For i = 1 to System.Sessions.Count
             MsgBox System.Sessions.Item(i)
         Next
     End If
Next
 

You are correct Skie that's what happens

This code didn't work:
Says complie Error, Variable not found on wShell.
 
Solution Found:

I finally found out that Mainframe is the default session that is setup when Extra was installed. All I had to do was rename my Mod4 session to Mainframe, works like a charm now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top