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
  • In your script you would have, at the top;
    Sub Main (strVariable As String)

    So basically every time you run this script, and pass a variable to it (by using the ARG thingy) it will set the VB variable strVariable to that value.
    In your VB file you would use the strVariable variable, which would be the work order.

    And, of course, don't forget the End Sub

    EDIT:
    So I think it would look something similar to

    Sub Main (strVariable As String)
    [I]Code involving the excel stuff...[/I]
    
    xlSheet.Range("D1").Value=strVariable
    
    [I]Probably more code involving excel..[/I]
    
    End Sub
    
Reply
  • In your script you would have, at the top;
    Sub Main (strVariable As String)

    So basically every time you run this script, and pass a variable to it (by using the ARG thingy) it will set the VB variable strVariable to that value.
    In your VB file you would use the strVariable variable, which would be the work order.

    And, of course, don't forget the End Sub

    EDIT:
    So I think it would look something similar to

    Sub Main (strVariable As String)
    [I]Code involving the excel stuff...[/I]
    
    xlSheet.Range("D1").Value=strVariable
    
    [I]Probably more code involving excel..[/I]
    
    End Sub
    
Children
No Data