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

Newbie to !Extra Programming 2

Status
Not open for further replies.

Yesuslave

Programmer
Sep 24, 2003
28
US
Hi all,

OK, so I've browsed this forum and am confused. I've worked with VB and VBA through Excel and have written some fairly complex macros, but have no real formal training. I'm interested in writing some macros for my office where we use !Extra Personal Assitant 6.5. I am somewhat confused by the abrupt nature of some of the "introductory" FAQ's that I've seen here, and need a bit of a step up before I get to them.

Where should I look to find the most basic beginning (with annotations so i can understand the code I'm using) to writing macros for !Extra?

Any help would be most appreciated.

Thanks a lot,
Joshua Wise
Jwise@yesbank.com
 
If you use VB and VBA, I'd suggest you use those languages to control Extra. They are much more robust and have a better editor. I have a FAQ out there for how to do this.

If you really want some additional info and my FAQ doesn't help, what exactly do you need to know (I can update my FAQ)? Have you tried the help files?

calculus
 
Hey,

I'm talking about really basic stuff, like which .Dll I should be using. I tried to add hllapi.dll, hllapi32.dll, hlldos.dll, and hllproxy.dll and Excel will not let me. Now, I am using Excel 97 :( for all of this, so I don't know if that is what is hurting me here, or what.

Your FAQ is good if I had some points of reference here for the Extra Basic script, which I've looked at, but find myself floundering. Even calling a simple session of !Extra doesn't seem to work.

Sorry if this is too nebulous, but I don't really have a starting point for my problems except that I can't do anythign at all. :)

Thanks,
Joshua Wise
 
When I first started … which wasn’t long ago … I had a hard time making my first connection from Excel to Extra. I wanted to use VBA to communicate through HLLAPI. I’m not a great programmer and my needs were not complex … so everything I read was way over my head.

HLLAPI function calls seemed easier for my needs than getting deeper into VB(A) or Extra Basic. In the long run, that may or may not be a wise move; however, it allowed me to gain experience without a huge initial learning curve.

Today, I posted a question in the Attachmate forum under MIS/IT to help me get through a specific problem. My post includes a sample declaration for the HLLAPI function, a calling function, and a sub routine to make the HLLAPI connection (function 1). This code should work for you if you change the path to your DLL file.

It’s not much but maybe it’ll help you get started if you want to connect using a HLLAPI session.
 
I can't get hllapi.dll to work as a reference for VBA. Whenever I try to add it as a reference I get "can't add a reference to the specified file." I've tried this in many different VBA projects with all the hllapi files in my
!Extra32 folder, none work. Any idea why this is?

Thanks,
Joshua Wise
 
One of the problems I had initially was that the DLL files were installed; however, Extra was not configured to use HLLAPI. Under global preferences, there are several HLLAPI options. When I set a session document for the HLLAPI short name (by browsing to the session folder and selecting my current session file), it fixed my problem. I also turned on enhanced transport.

I hope this helps. Good luck.
 
There is some learning curve to Extra Basic. If you put the following code in a module in VBA, it will connect to the active Extra session and get a string at the X,Y coordinates you select. Also select the length of the string.

What version of Extra are you using? This is 6.5 or later.

Dim Sessions As Object
Dim System As Object
Dim Sess0 As Object

'Extra Objects
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
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object. Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object. Stopping macro playback.": Stop
'--------------------------------------------------------------------------------
MyString = Sess0.Screen.GetString(X,Y,Length)

Msgbox MyString

Set Sessions = Nothing
Set System = Nothing
Set Sess0 = Nothing
End Sub
 
Thanks,
That worked. However, when I put the following code in, the MoveTo statement only works if I step through the code, but it skips over if I run the macro normally. Any ideas on this?

Sub TPEnter()
'
' Macro2 Macro
' Macro recorded 09/25/2003 by Commerce Bank
'


Dim Sessions As Object
Dim System As Object
Dim Sess0 As Object

'Extra Objects
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
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object. Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object. Stopping macro playback.": Stop
'--------------------------------------------------------------------------------
Range("A1").Select

Sess0.Screen.SendKeys ("B")
strString = ActiveCell.Text & &quot;<ENTER>&quot;
ActiveCell.Offset(1, 0).Select
Sess0.Screen.SendKeys (strString)


'This is the line that gets skipped over

Sess0.Screen.MoveTo 7, 24

' The above line is the line that gets skipped over

Sess0.Screen.SendKeys (&quot;Collections Department<ENTER>&quot;)
Sess0.Screen.SendKeys (ActiveCell.Text)
Sess0.Screen.SendKeys (&quot;<Tab><Tab>&quot;)
Sess0.Screen.SendKeys (&quot;092503&quot;)





Set Sessions = Nothing
Set System = Nothing
Set Sess0 = Nothing
End Sub
 
Yes, I'd suggest that you PutString instead of using the SendKeys method.

So your first line of code would read:
Sess0.Screen.PutString &quot;B&quot;,X,Y

Where X and Y are the screen coordinates you need the string to go to. You will still have to use:
Sess0.Screen.SendKeys(&quot;<Enter>&quot;)

to send and Enter. Does &quot;Enter&quot; change screens for you? If so, you'll need to wait for the system to return with the new screen. The best way to do that is:

Do While Sess0.Screen.OIA.XStatus <> 0
Loop

calculus
 
After you a do a SendKeys <Enter> (or any PFkey Attenion key) you need to do a wait host Quiet (this is a function of the screen object). I am not at work so I can not give you an example
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top