Results 1 to 4 of 4
  1. #1
    genny is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    7

    Question run exe

    Hi,

    I created a .exe program in C++. The programs takes data from a file and does some cleanup and output a new file

    I want to run the program in access.I used this code


    Dim RetVal
    Dim Path As String

    Path="C:\Users\Genevieve\Documents\bourse_montreal \interlisted\interlisted.EXE"
    RetVal = Shell(Path, vbNormalNoFocus)
    MsgBox RetValue
    The program seems to run because , DOS prompt command pops-up and there is a value in RetValue

    but the programs doesn't seem to execute because it doesn't generate any output.

    By itself, the program runs perfectly

    Thanks for the help

  2. #2
    genny is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    7
    I did not get any reply so I wondering if it's because I am not clear or it's because it cannot be done. I'll try to be more precise

    I have .exe program that I want to run in VBA in ACCESS. The code below works if my .exe does not need external files to run as input

    So my question is it possible to run .exe program that I have need .txt files to run


    Dim RetVal
    Dim Path As String
    Dim File As String
    Dim File_1 As String

    Path = "C:\Users\Genevieve\Documents\bourse_montreal\inte rlisted\interlisted.EXE"
    File = "C:\Users\Genevieve\Documents\bourse_montreal\inte rlisted\interlisted.txt"
    File_1 = "C:\Users\Genevieve\Documents\bourse_montreal\inte rlisted\optionsbourse.txt"

    RetVal = Shell(Path, 1)

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    put .exe file path and .txt file path together:

    RetVal = Shell(Path & " " &file & " " & file_1, 1)

  4. #4
    genny is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Hi,

    I had tried that and still doesn't work. I tried it also by replacing & by +.
    I get the DOS prompt but it stays there , the program seem to start but doesn't seem to finish.

    if I do : MsgBox RetVal. I get a value confirming the program starts but it doesn't finish.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums