📜  vba 运行带参数的 shell 命令 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:11.247000             🧑  作者: Mango

代码示例1
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