I use the following VB code to execute a file Shell ("FilePath"
When this code executes, I could see a flash in the task bar that it was opened but then immediately exits. I use Windows 2000, does this have anything to do with it?
Maybe a bit of debugging is called for. If you put msgboxes before and after each program line you will be able to see how far the program gets before it bails out on you.
I tried setting the window state before but that didn't work either. I found the following code snipplet on the web and it worked.
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
hh2424,
not sure if it can be the case but we have experienced following problem:
if working directory for a program (PIF file) set incorrectrly (like, network drive not connected) program just quit in Win 2000.
You could check if you have any settings for path.
I use the following VB code to execute a file
Shell ("FilePath"
If FilePath is a variable holding the path of the executable then the quotation marks have turned it into a string.
And I believe you do have to put in an absolute path too.
________________________________________________________________________________
You can't put a square peg in a round hole without a lot of force.
If at first you don't succeed get a bigger hammer. - Steve 2003.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.