You must be doing it wrong then, because using Shell from Excel works to run a Perl program. What error did the Shell function raise? Most likely, it will help if you start your script as Shell "perl -w c:\full\path\to\perl\script.pl some commands". But this is mostly a Visual Basic (for Applications) question and not a Perl question and hence off-topic here.
| [reply] [d/l] [select] |
The VBA shell function runs a shell command immediately and then returns. It doesn't wait for the command to finish and it doesn't provide for a way to get the command's standard out stream or even exit code. That may be why you are getting "no result".
If you are expecting information back from your Perl script, there are some alternatives. You could try the recommendataions here, but as you can see its pretty long-winded and complicated code. This link supposedly provides a function that waits till the command is done, but even it doesn't get you the output to STDOUT or the exit code. You would have to make additional arrangements to write to and read from a named output file if you need output from your command.
I've never tried this script, so use at your own risk. Personally, I haven't had much luck getting Excel to wait and return results from external commands reliably.
Best, beth | [reply] |
| [reply] |