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!

Starting a Session 1

Status
Not open for further replies.

SkipVought

Programmer
Dec 4, 2001
47,487
US

I have interited a screen scraper application in an Excel Workbook. I have already learned some things by examining the code and by reading several postings and FAQ99-4069.

Is it possible to start the Extra!Personal Client from VB?

It seems that all the posts I have read, assume that the client is active.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 

BTW, I have tried using a Shell command to open the client
Code:
    Dim result
    
    result = Shell("C:\Program Files\E!PC\Sessions\Mainframe.edp", vbMaximizedFocus)
but I get an error message
[tt][highlight]Invalid procedure call or argument[/highlight][/tt] with or without the second argument.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
In our office Extra is always open. I usually do a check to see if it is at the start of code, but you could fire it from VB. You'd need to know what session (*.edp) file you open Extra with, then use the shell command.

The challenge will be timing. Extra takes 15 seconds to a minute to open depending on what else is happening on the PC. I'm not sure it's very feasible.

calculus

 


Thanks, calculus, but I'm stuck on the Shell statement error, as I posted previously.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
Sorry, we were posting at the same time. You need to shell the exe and feed it the session file.

result = Shell("C:\Program Files\E!PC\extra.exe C:\Program Files\E!PC\Sessions\extra.edp")

calculus
 
Skip,

The following Shell works with an adp session (old School) but it should work with your .EDP. It was written in EB but should drop right into VB, well hopefully.

Code:
Sub Main
Dim oShell as object
 
strAppPath = Chr(34) & "C:\Program Files\E!PC\Sessions\Mainframe.edp" & chr(34)
 
Set oShell = CreateObject("Wscript.Shell")
Call oShell.Run(strAppPath)
Set oShell = nothing
 
End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
BTW Skip

Surely this answer could be found at the elusive
Skip said:
Tek-we-write-the-code-for-your-project.
link. I'd gladly do the research for you but i'm still waiting on your link. [ROFL]



[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 


Luv yer moniker. As Yogi would say, "Deja vu, all over again!"

And, yes, I'm working on that link. It's been a life-long en-devour.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
Code:
Set objExtra = CreateObject("Extra.System")
Set objSession = objExtra.Sessions.Open("C:\Program Files\E!PC\Sessions\Mainframe.edp")
 
Wow, I really like that Skie, it sure beats my brute force method. It worked in EB does it also work in VBA?

Well yes it does
Code:
Dim objExtraSession As Object
Set objExtraSession = CreateObject("ACCMGR.System").Sessions.Open("D:\Host Sessions\OSC_IDRS.adp")
worked great for me.

Skip, Did you reference your Extra in VBA as described in Calculus's FAQ? It's helped me a lot. Also it's nice to have one more person to bounce the VBA stuff around with, not a whole lot of folks find their way in here.


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 


yes, I did. Nice to link into the Extra!Help.

I've already taken the program that I inherited and created a UDF that the user can have on their worksheet to return Promise Dates. I wanted to include the ability to open the client if the user forgot.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 


Thanx Skie. Got it to where I can login to an IMS session. Appreciate your help!

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top