Results 1 to 2 of 2

Thread: Sending text from a STR variable

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    8

    Sending text from a STR variable

    Ok I know this is a newb question but well I am one. How do i send the str variables in the belwo script to another program?
    The variables are saved in excel spreadsheet and pull fine with the wscript.echo command but. I have tried the below commands to send it to a program called vista TN3270 emulator the program opens fine form the script but the data is not sent to screen.

    I have used:
    wscript
    sendkeys
    prtsc

    none seem to work the way I need.

    Below is script it is basic but once I figure this out I can build (or try to learn how to) the rest of what I need pulled from excel into the program.

    ' Scott Williams Test 1A
    '
    '

    Dim yourid, yourPSWD, strYourID

    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open _
    ("C:\ExcelSheet\ocean1.xls")

    intRow = 2

    Do Until objExcel.Cells(intRow,9).Value = nil
    Wscript.Echo "YourID: " & objExcel.Cells(intRow, 9).Value
    strYourID = "YourID" & objExcel.Cells(intRow, 9).Value
    Wscript.Echo "YourPSWD: " & objExcel.Cells(intRow, 10).Value
    'Wscript.Echo "Last Name: " & objExcel.Cells(intRow, 3).Value
    'Wscript.Echo "Country Code: " & objExcel.Cells(intRow, 4).Value
    'Wscript.Echo "Model ID: " & objExcel.Cells(intRow, 5).Value
    'Wscript.Echo "Printer: " & objExcel.Cells(intRow, 6).Value
    'Wscript.Echo "Station: " & objExcel.Cells(intRow, 7).Value
    intRow = intRow + 1

    Loop

    objExcel.Quit


    'Opens Ocean transmits Data

    Dim objShell 'Holds WshShell object
    Dim objExecObject 'Holds what comes back from executing the command
    Dim strText 'Holds the text stream from the exec command.
    Dim command 'The command to run

    command = "cmd /c C:\VistaTN3270\vistaTN3270.exe Ocean.ses"
    'WScript.echo "starting program " & Now 'Used to mark when program begins
    Set objShell = CreateObject("WScript.Shell")
    Set objExecObject = objShell.Exec(command)




    PRTSC yourid




    thank you for any help you can give. Also can anyone tell me why the belwo line does not stop once the cell in excel is blank? I use the below line:
    Do Until objExcel.Cells(intRow,9).Value = nil

    I have replace nil with blank and also tried 0 and put a 0 in the last sell it doesn't seem to care.

    Oh I am also using PrimalScript to edit the scripts if that makes any difference.

    regards
    Siens

  2. #2
    Addicted Member sauronsmatrix's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    133

    Re: Sending text from a STR variable

    Sounds like you're trying to make a macro or something.

    This program [autohotkey] is great for scripting those.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width