I'm calling a custom written executable using the shell command from a Windows 7 machine, and a laptop running Windows XP. Common denominator was to save the spreadsheet as an Excel 97 workbook.
The executable (correctly) reads a text file containing custom scripting, and sends commands out a USB port thru GPIB translator module (Prologix), and after equipment is set up, my executable writes out a text file consisting of data the Prologix module gathered by scripted read commands.
That works.
On the Windows 7 machine my executable outputs the file to the same directory as the executable.
On the Windows XP machine it outputs the file to the same path reported by VBA using the command "? application.defaultfilepath" in the immediate window.
I can "patch" this in excel, but it is best to change the executable to force a known path. Problem is, I'm wondering if the executable is "fooled" into thinking it is elsewhere by the shell() command setting up a DOS environment for it in one version of excel that is different in another version?!
Anybody come across a solution or know what (undocumented?) mechanics rest behind the shell() command? It just seems easier to ask than to try and write a test snippet in C to "start guessing" at environment variables, etc.
TIA
Grug
Bookmarks