Note that there are some explanatory texts on larger screens.

plurals
  1. POVBA Shell command always returns "File Not Found"
    text
    copied!<p>I'm using VBA for MS Access in order to link a small C# app to my database as a helper tool. I have tried a couple of different ideas from stackoverflow itself, including the ShellAndWait utility and another on that page.</p> <p>I have a button on a form. When you click this button, it should run another application that I am currently storing in <code>%APPDATA%/program/</code></p> <p>This is the code that is currently active:</p> <pre><code>Private Sub BtnImport_Click() Dim file As String Dim hProcess as Long file = Environ("APPDATA") &amp; "\program\component_import.exe" 'This is the standard version, which apparently does nothing at this time. hProcess = Shell(file, vbNormalFocus) 'This is the RunApplication version I got from here earlier. It ends 'with "Successfully returned -532462766 import_funcs.RunApplication(file) 'This is the ShellAndWait version, which gives me a "File not Found" error import_funcs.ShellAndWait(file, 0, vbNormalFocus, AbandonWait) End Sub </code></pre> <p>I had changed the original shell out for both the ShellAndWait module and another similar module. Neither of those options work any differently in terms of my application not starting.</p> <p>I have double-checked that "file" is correct (It points to <code>C:\Users\Me\AppData\Roaming\program\component_import.exe</code>). I have double-checked to make sure that my app is in the correct location. </p> <p>It runs fine if I double-click from file explorer. It says <code>Run-time error '53': File not found.</code> whenever I attempt to run it from MS Access.</p> <p>Any suggestions?</p> <p>Edit: As an aside, the path itself does not contain any spaces.</p> <p>Edit: Added some additional code. Link to first pastebin: <a href="http://pastebin.com/8NXUjRwF" rel="nofollow">RunApplication pastebin</a> Link to second pastebin: <a href="http://pastebin.com/9VPqAYNY" rel="nofollow">ShellAndWait pastebin</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload