The Excel Shell () function probably ignores file associations. You almost certainly have to say something more:
Function Chk() Dim RetVal Chk = Shell("C:\Perl\bin\perl.exe C:\Perl\bin\Hello.pl", 1) End Function
to get the desired effect. Two changes that need to be noted are, firstly, an explicit call to perl.exe, and secondly, a minor syntax error in your function, as it is written.
Please note that if the path to perl.exe or the path to your script (or any additional arguments for your script too) have spaces in it, then you will need to create a line, quote them, quoting them:
Function Chk() Dim RetVal Chk = Shell("C:\Perl\bin\perl.exe ""C:\Some path\with spaces\Hello.pl""", 1) End Function
would do the trick.
source share