Answers for "vba run shell command with arguments"

0

vba run shell command with arguments

Sub ExecuteShell(path As String, ParamArray arg() As Variant)
    Dim element As Variant
    Dim cmd As String

    cmd = path & " " 'insert any pre-arguments charaters

    For Each element In arg
        cmd = cmd & element & ", "
    Next element

    'remove last comma
    cmd = Left(cmd, Len(cmd) - 2)

    Call Shell(cmd)

End Sub
Posted by: Guest on September-30-2021

Code answers related to "vba run shell command with arguments"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language