×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to get a string back from a SHELL Call

How to get a string back from a SHELL Call

How to get a string back from a SHELL Call

(OP)
I am using Extra V6.7 and need to populate a string variable within an Extra Macro with some text that is unable to be read directly by the Extra Macro.  I have written a VB6 .EXE programme that will read the required text from the remote location when supplied with the three input variables.  The problem is that I cant suss out how to get the required text back into the extra macro.

The dirty work around that I am using at the moment is for the VB6 programme to read the text then save it to a text file on the local PC, the Extra Macro then reads this text file after the VB6 programme has run and loads it into the required string variable.

There must be a way to do this but it is not something that I have done before.  I'm fine with dooing it the other way around...   driving Extra from Word, Excel, Access or VB but in this case I need the Extra Macro to do the driving and get the answer.

Dim ToBeSent As String
Dim MyShell As Single

'I need to pass three strings the the .EXE programme.
ToBeSent = "MySrtVar1,MyStrVar2,MyStrVar3"
'Add the location of the programme.
ToBeSent = "C:\MyProggy.exe " + ToBeSent + ","
MyShell = Shell(ToBeSent,1)
Msgbox MyShell 'This will now contain a number.
    
'Then later I read the .txt file and load the text into a variable for processing.
Open "C:\MyTextFile.txt" For Input As #FileNumber

Anyone got any pointers.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close