Calling a .vbs script from Excel VBA

后端 未结 4 1971
眼角桃花
眼角桃花 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:40

    I only want to add to Alex' answer, that in some environments the object must be created in the following way:

    set scr = CreateObject("MSScriptControl.ScriptControl")
    

    If Alex adds this to his answer, I will delete this one.

提交回复
热议问题