Calling a .vbs script from Excel VBA

后端 未结 4 1970
眼角桃花
眼角桃花 2020-12-08 08:43

Is it possible to call a .vbs script from a VBA code whenever needed? If possible then can you give me a sample code of how to do so?

4条回答
  •  没有蜡笔的小新
    2020-12-08 09:44

    You may want to use """ if your path name contains a - For me the following solved this issue:

    Shell "cscript """ & ActiveWorkbook.Path & """\your.vbs", vbNormalFocus
    

提交回复
热议问题