Closing word application from excel vba

前端 未结 3 686
死守一世寂寞
死守一世寂寞 2021-01-21 00:34

I\'m trying in the beginning of my macro to close all word application if it\'s open, although I don\'t no which documents are open, and I can\'t set them as an object. Thanks.<

3条回答
  •  -上瘾入骨i
    2021-01-21 01:14

    Another option is to use Shell to accesss the elegance of powershell

    Sub Comesfast()
    X = Shell("powershell.exe kill -processname winword", 1)
    End Sub
    

提交回复
热议问题