I have researched and tried a bunch of flavored variationsfrom http://www.mvps.org/dmcritchie/excel/shell.htmBut no joy.The following VBA line works but requires me to embed my associated filein a batch file first. What I would like is to "run" or "start" the .vmxfile directly as can be done from the Run command or within Explorer.RetVal = Shell("c:\vmfg.bat", vbMinimizedNoFocus)Contents of vmfg.bat:c:\Vmfg.vmxAccording to the Website something like this should work but I get a"file not Found" errorShell "start c:\Vmfg.vmx"
Try leaving the "Start" out.Get back to us if it doesn't work.
unfortunately, removing the "Start" does not work but as I understandit Shell requires an executable (.EXE, CMD, BAT, .COM).I might have to accept the clunky workaround and build both textfiles. YUCK!open to another suggestion...
As I read the page at the link I sent, shell *doesn't* look for the items inthe environment variable "pathtext" if there is an extension on the firsttoken of the command line and command extensions are enabled.There is also documentation on the CMD command athttp://www.computerhope.com/cmd.htm.Does the file run if you open a command window manually and type the programname?
the .VMX associated file will auto launch the windowsfile from a Dos Command line.example may help but the application (.exe) I amrunning does NOT accept parameters directly - hence the need for thelaunching from the associated file.
any working examples using VBA's shellcommand with associated filetype?
And perhaps check out the syntax of the start command....http://www.computerhope.com/starthlp.htm
I'm not familiar with the application.Does it accept a filename on the command-line?Perhaps you can use something like:("C:\msoffice\excel.exe """ & fullpathandfilename & """")gotta watch the embedded quotes...I know I've done something like that, but it's at work.
What aboutDim myShell As ObjectSet myShell = CreateObject("WScript.Shell")myShell.Run "c:\Vmfg.vmx"?
Thanks, but I can't take credit for it. Here's the original:http://tinyurl.com/684zg4
Perhaps but you "Beat" Google... (granted, I limited my search with"Excel VBA".)