0

So:

I'm taking a crash course meant to prepare me for tech interviews with coding boot camps like App Academy. The course is taught in Node.js, and we run our exercises through the command prompt like this: "C:\Users\Mike\Exercises>node problemSet.js".

Now, I have a little MS Access app I cooked up a while back to function something like a set of smart flashcards. I'd like to expand on it so that it can show me a coding exercise, run whatever solution I type out in the Access Form through Node.js, and check that it generates the correct output.

I was hoping to accomplish this with the VBA Shell function, but it seems to only work with .exe files. If I try running it on something like the path in the first paragraph, I get "File not found" because there's no file called "node problemSet.js", just "problemSet.js" that I'm used to running by entering "node problemSet.js" into the command prompt.

Any suggestions?

Erik A
  • 31,639
  • 12
  • 42
  • 67
  • try to supply the absolute path to node executable – Vladimir M May 13 '17 at 19:20
  • See if this helps (my expectation is this should work the same way with node): http://stackoverflow.com/questions/39516875/return-result-from-python-to-vba/39517658#39517658 – Vasan May 13 '17 at 19:21
  • I tried the following with no result: Shell("C:\Program Files\nodejs\node.exe C:\Users\micha\OneDrive\AppAcademy\Interview Prep\tst.js", vbNormalFocus)) – ProdigalBulldog Jun 08 '17 at 15:31
  • I also tried creating a WScript.Shell object called objShell and using Set objExec = objShell.Exec("C:\Program Files\nodejs\node.exe C:\Users\micha\OneDrive\AppAcademy\Interview Prep\tst.js"). Still no luck. – ProdigalBulldog Jun 08 '17 at 15:34
  • The space may be messing up the parameters to shell, try to insert quotes around each path. It may help to test in cmd before trying it in vba. – Jason K. Oct 06 '17 at 16:21

0 Answers0