How can I execute a shell command using VBA?

前端 未结 2 657
悲&欢浪女
悲&欢浪女 2020-12-03 14:50

I want to execute a shell command like the following using Visual Basic for Applications.

C:\\Temp\\gc.exe 1

How can I do it?

2条回答
  •  时光说笑
    2020-12-03 15:24

    Example:

     retVal = Shell("C:\Temp\gc.exe 1", vbNormalFocus)
    

    Link: Shell Invoked from VBA

提交回复
热议问题