Hi dinesh_ltjd,
It looks like you're combining both early and late binding, which isn't working. The most common method i've seen used for this is late binding, which I've modified your code to use:
Sub ConnectToAttachmat()
Dim oSys As Object
Dim oSess As Object
Dim oActive As Object
Dim oScreen As Object
Set oSys = CreateObject("Extra.System")
If oSys Is Nothing Then
MsgBox ("Could not create the Extra.System object...is E!PC installed on this machine?")
Exit Sub
End If
'GET ACCESS TO THE CURRENTLY ACTIVE SESSION...
Set oSess = oSys.Sessions
If oSess Is Nothing Then
MsgBox ("Could not create the Sessions collection object...stopping macro playback.")
Exit Sub
End If
Set oActive = oSys.ActiveSession
If oActive Is Nothing Then
MsgBox ("Could not create the session object...stopping macro playback.")
Exit Sub
End If
Set oScreen = oActive.Screen
'display the first 40 characters on line 1 after character 19 in a message box
MsgBox (oScreen.GetString(1, 20, 40))
End Sub
Edit: I thought I'd also show you early binding, as it is easier to develop code using early binding as it exposes the object library, which allows the use of "intellisense" and syntax checking. However, it is recommended that you change it to late binding when releasing your code, especially if you're unsure of the software versions being used on other users' PCs.
Sub ConnectToAttachmatTwo()
Dim oSys As EXTRA.ExtraSystem
Dim oSess As EXTRA.ExtraSessions
Dim oActive As Object
Dim oScreen As EXTRA.ExtraScreen
Set oSys = New EXTRA.ExtraSystem
If oSys Is Nothing Then
MsgBox ("Could not create the Extra.System object...is E!PC installed on this machine?")
Exit Sub
End If
Set oSess = oSys.Sessions
If oSess Is Nothing Then
MsgBox ("Could not create the Sessions collection object...stopping macro playback.")
Exit Sub
End If
Set oActive = oSys.ActiveSession
If oActive Is Nothing Then
MsgBox ("Could not create the session object...stopping macro playback.")
Exit Sub
End If
Set oScreen = oActive.Screen
'display the first 40 characters on line 1 after character 19 in a message box
MsgBox (oScreen.GetString(1, 20, 40))
End Sub
Enjoy! 
Bradbb
Bookmarks