open an exe file (1 Viewer)

24sharon

Registered User.
Local time
Today, 04:16
Joined
Oct 5, 2004
Messages
147
Good evening


Hello friends

I have a problem

I did a project in access, in my project I have to open an EXE file,

I tried with many ways to open this file:

1.
stAppName = "C:\Program Files\BCCLTD\Msv.exe"
Call Shell(stAppName, 1)

2.
Function TLink(ByVal URL As String) As Long
TLink = ShellExecute(0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus)
End Function

3.
Function OpenFile(sFileName As String)
OpenFile = ShellExecute(Application.hWndAccessApp, "Open", sFileName, "", "C:\", 1)
End Function

And all the time I get an error, that missing some parameters.
<Attach the error> - Sorry it’s in Hebrew

The point is that if I go to the folder and open the file and the file open…

Is there a way to open the file from the mother’s folder?
SORRY, but I attached another file, in the properties of a shortcuts here you can see that you can write “START IN” and it open from the folder.

Is there a way to do like this in access?

I hope that u understand me!
Thanks a lot

Sharon
 

Attachments

  • untitled.JPG
    untitled.JPG
    9.6 KB · Views: 220
  • untitled2.JPG
    untitled2.JPG
    35.1 KB · Views: 225
Have you tried :

Code:
Call Shell ("explorer.exe C:\Program Files\......",5)

Regards

Andy
 
no

It's try to open the file with the explorer

and it try to download it :)

if you click to open it i got the same ERROR
"MISSING FBAKARA.MSV" :(

There is another way? :rolleyes:

spacepro, THANKS...
 

Attachments

  • no.JPG
    no.JPG
    41.5 KB · Views: 232
Last edited:
Sharon,

I tried the code without explorer.exe and the code works fine just like the first example you gave. I did notice in the screenshot of the shortcut link to the program in the Start In box the C:\Program Files..... should be in quotes like "C:\Program Files\..."

The only other suggestion is to open the folder by using :

Code:
Call Shell("explorer.exe C:\Program Files\BCCLTD\",5)

Hope this helps

Andy
 
Your second idea opens the folder, and then if I click the EXE file it open without the error, but I want to open the file automatically.

thanks again on your times...
 
Sharon,

Sorry I couldn't be more help, but the code should open the file automatically, it certainly works on an exe file on my pc.

Good Luck!

Andy
 
Sharon,

The error that is generated, is this in access or windows.

If it's access then is there a module or underlying code that looks for a file ?

Try creating a blank db and create a form with a cmd button and put the code:

Code:
Call Shell("C:\Program Files\...",5)

Hope this helps

Andy
 
OK

I’ll try to explain again

I have a folder BCCLTD in Program Files.

There I have a file
Msv.exe – this file I want to open.

This file looks for another file “FBAKARA.MSV” that also in this folder

My access program is in another folder “C:/KEVA/keva.mdb”
If I tried to open the “msv.exe” file from another folder, then the program don’t find the other files and it doesn’t work.

AND IN SHORTS WORDS

Is there any way to open a file from the folder that the file in?

THANKS,
sharon
 

Attachments

  • untitled.JPG
    untitled.JPG
    91.8 KB · Views: 218
Did you try...

Call Shell("C:\Program Files\BCCLTD\MSV.exe C:\Program Files\BCCLTD\FBAKARA.MSV", vbNormalFocus)
 
same ERROR :(

There is no function like

Call Shell("C:\Program Files\BCCLTD\MSV.exe C:\Program Files\BCCLTD\FBAKARA.MSV", "C:\Program Files\BCCLTD")
:confused:

THANKS AGAIN
 
how about using chdir? the code might be looking for FBAKARA.MSV in the KEVA directory. Maybe either copy FBAKARA.MSV to the KEVA directory or use ChDir("C:\Program Files\BCCLTD\") before the call shell line?

Sorry I haven't had time to test this so I could be completely wrong! :o
 
I DON’T BELIVE….

I GOT IT….


davidoc, ghudson, spacepro Thanks all
davidoc you right!

ChDir ("C:\Program Files\BCCLTD\")
Call Shell("C:\Program Files\BCCLTD\MSV.exe C:\Program Files\BCCLTD\FBAKARA.MSV", vbNormalFocus)

Open the file good!

Good day!
 
Glad you got it working but you shold not need the change directory piece. The code you posted back with is not what I gave you for you added an option [,"C:\Program Files\BCCLTD"] that is not allowed with the Shell command. The code I gave you above should do it since it is calling the FBAKARA.MSV file to be opened with the the MSV.exe program.

Code:
Call Shell("C:\Program Files\BCCLTD\MSV.exe C:\Program Files\BCCLTD\FBAKARA.MSV", vbNormalFocus)
 
DEAR ghudson

There is a sentence in my language that says
If something work well don’t touch.(=

But otherwise I try to do your example and I got the ERROR, :(

Thanks a lot for your answer and your advices all the times. :)


Sharon
 

Attachments

  • untitled.JPG
    untitled.JPG
    31 KB · Views: 228

Users who are viewing this thread

Back
Top Bottom