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

How to open Attachmate using notepad file

Status
Not open for further replies.

Biznez

Technical User
Apr 9, 2015
106
CA
I like to open an Excel file and Attachmate mainframe using notepad. Is this possible?

Thanks
 
HI,

Could you explain?

Whatever code you might write in Notepad, needs to either be compiled in an appropriate compiler or run in an interpreter.

???

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
For example, i put this code below in notepad and saved the file as "Testing.vbs". Now when i double click on this file, excel application and the workbook testA.xlsm opens. I would like to do the same for Mainframe.


Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\testA.xlsm")
objExcel.Application.DisplayAlerts = False
objExcel.Application.Visible = True
 
So do you have Attachmate!Extra or some other terminal emulator?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Attachmate HELP is your friend.

I don't have the answer at hand, but I've done this from Excel in the murky past.

1) find the path to your Attachmate!Extra application.

2) find the EB syntax for Open.

So after setting the System object (as per the FAQ) open the application. Then set the Session object. Screen is a property of the Session object.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Okay, IMNSHO, using VB Script in this instance, that is opening Attachmate AND Excel, is a poor choice.

In my experience, I was not a big emulator user except for scraping screens for some of my users. And since I was scraping screens, the target for my scraped data was ALWAYS Excel. Consequently, I ran ALL by screen scrapes from a single Excel workbook, in which I built a system for scraping screens. In that way, that is running in Excel VBA, I could load the Attachmate Object Library. Here are some snippets from the code from my Attachmate module in that workbook...

Code:
Option Explicit
[b]'you must have a reference set for Attachmate EXTRA! n.m Object Library
'runs with Form ufmPassword
'declare Public variables
[/b]
Public oSystem As ExtraSystem
Public oSessions As ExtraSessions
Public oSess As ExtraSession
Public oScrn As ExtraScreen
Public vPassword
Public sCurrentScreenName As String
Code:
Sub IMS_Login()

    Dim result, bLogin As Boolean
    
    Set oSystem = CreateObject("Extra.System")
    
    If oSystem.Sessions.Count = 0 Then
        [b]Set oSess = oSystem.Sessions.Open("C:\Program Files\E!PC\Sessions\Mainframe.edp")[/b]
        ufmPassword.Show
        bLogin = True
    Else
        Set oSess = oSystem.ActiveSession
        bLogin = False
    End If
'....
'other stuff
End Sub

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks SkipVought, that makes more sense. Let me give this a try
 
Hey Skip, i have this code below. however, when it tries to close it, there is a pop up box asking me if i want to disconnect sessions Mainframe. I just want it to close without having to click on yes or no.


Sub test()
Set oSystem = CreateObject("Extra.System")
Set oSess = oSystem.Sessions.Open("C:\EXTRABAK\SSL - Mainframe.edp")
oSess.Visible = True
oSess.Close
End Sub
 
Have you checked EB HELP?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Extra Basic HELP. Lots of good stuff including code examples.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Looking but cant seem to find what im looking for. even looked under Macros. dont have any examples
 
got it :)

just turned off the prompts under Options | Global Preferences
 
Did you find and open HELP?

What search term did you use?


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top