PDA

View Full Version : Shell commands not opening certian exe's



chacanger
06-19-2013, 12:38 PM
Hello

I've recently tried getting my code to open a .exe file through means of VBA's shell function. Usually this is a reliable method of opening programs for example cmd.exe, notepad.exe, even games.

However there is one application that will not open through this method even though when you click on the files target icon in explorer, run it from Run.exe or even from internet explorers address pane.

It comes up with a vague error "A DLL is missing", it doesn't even say which one and if it's missing, why would it work through normal means? :dunno

So my question is, are there any other ways to open an .exe file?

Here is my basic code:

Sub TestShell()

Dim AppTarget As String

AppTarget = "C:\Program Files\Work Manager\WorkManager.exe"
Shell AppTarget

End Sub


Any suggestions are much appreciated.

SamT
06-24-2013, 06:03 PM
"Run" Regedit.exe, and search for "WorkManager.exe" and look at the Shell command (folder) in Regedit for the command line. You may have to copy this line and use it in your code.

Paul_Hossler
07-02-2013, 04:17 PM
Hello
Any suggestions are much appreciated.

Might be because of the spaces in the path

Try this and see. It just brackets your path with quotes


AppTarget = """" & "C:\Program Files\Work Manager\WorkManager.exe" & """"


Paul