hexagon logo

New to VB

I'm trying to pass a variable for work orde number from pc-dmis user input

C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
What is the Work Order #?
ASSIGN/V1=C2.INPUT

to VB script which creates excel file. The WO# has to go to a specific cell (D1).

Thanks
Parents
  • If this is a script that you call from your part program, you can pass the variable to the script like this:
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Enter the WORKORDER number
                ASSIGN/VAR_WO=C1.INPUT
    CS1        =SCRIPT/FILENAME= C:\DATA\SCRIPTS\ARGTEST.BAS
                FUNCTION/Main,SHOW=YES,[B][COLOR=#FF0000]ARG1=VAR_WO[/COLOR][/B],,
                STARTSCRIPT/


    Then modify the script to receive it like this:
    Sub Main [COLOR=#FF0000][B](str As String)[/B][/COLOR]
    
    MsgBox(str)
    
    End Sub


    I'm assuming there's plenty of examples in your existing script to show how to put data into a specific cell in the spreadsheet.
Reply
  • If this is a script that you call from your part program, you can pass the variable to the script like this:
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Enter the WORKORDER number
                ASSIGN/VAR_WO=C1.INPUT
    CS1        =SCRIPT/FILENAME= C:\DATA\SCRIPTS\ARGTEST.BAS
                FUNCTION/Main,SHOW=YES,[B][COLOR=#FF0000]ARG1=VAR_WO[/COLOR][/B],,
                STARTSCRIPT/


    Then modify the script to receive it like this:
    Sub Main [COLOR=#FF0000][B](str As String)[/B][/COLOR]
    
    MsgBox(str)
    
    End Sub


    I'm assuming there's plenty of examples in your existing script to show how to put data into a specific cell in the spreadsheet.
Children