Results 1 to 2 of 2

Thread: Userform to Shell function.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    singapore
    Posts
    86

    Arrow Userform to Shell function.

    I've got a Userform in Excel where by I take in 5 values...Section, date,time,no.of periods and mins(in integer) from textboxes. When I get this values and click a command button, my program goes thru many processes after which I'm calling a Shell func(NOT in the Form Module but a normal module called ShellFunc). My Shelled program is a perl program that creates txt files. In order to do tat, I need to pass in 5 arguments when running the perl program.How to pass in the values taken from the userform to the Shell function.By the way,my shell program is not working too.
    PHP Code:
    Result ShellExecute(gScr_hDC"Open""c:\windows\desktop\CreateAct\CreateActivity.pl"" 2,20/03/2003 ,13:15:00,8 ,30""C:\", gSW_SHOWNORMAL) 
    2(section),20/03/2003(date) 13:15:00(time), 8(no.of periods),30(interval)
    It'll b gd if i can get help on that too..PLs help.Thanks alot for ur help.
    Last edited by ITboy; Apr 15th, 2003 at 05:23 AM.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Firstly there's a "\" character missing from the path to your perl
    program - is the extension correct here too?

    Next up, the parameters argument is in bold below & comes
    before the directory argument in the API call:
    VB Code:
    1. [color="#0000A0"]Dim[/color] strParams [color="#0000A0"]As[/color] [color="#0000A0"]String[/color]
    2.  
    3. strParams = text1.Text & "," & text2.Text [color="#00A000"]'etc[/color]
    4.  
    5. ShellExecute Me.hWnd, vbNullString, _
    6. "c:[b]\[/b]windowsdesktopCreateActCreateActivity.pl", _
    7. [b]strParams[/b], "C:\", CLng(1)

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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