in reply to Excel Button to Run Perl

Associate the button with the pushbutton sub shown:

Sub pushbutton() arg = Range("A1").Value cmd = "cmd /k perl -le ""print @ARGV"" " & arg Call Shell(cmd) End Sub

You would, of course, change the address to whichever cell you want, and edit the calling command to refer to your script instead of the commandline-specified script in the -e ""..."". You might need to add quotes around the arg part of the string, depending on what you're passing, and what you're doing in the script.

Replies are listed 'Best First'.
Re^2: Excel Button to Run Perl
by rd48sec (Novice) on Feb 21, 2017 at 16:46 UTC
    Got it to work with a couple changes. Needed to Dim variables and use CStr function. Thanks for the help!
    Sub pushbutton() Dim arg String Dim cmd String arg = CStr(Range("A1").Value) cmd = "cmd /k perl -le ""print @ARGV"" " & arg Call Shell(cmd) End Sub