WinWord.exe won't close

二次信任 提交于 2019-12-25 09:40:58

问题


I am running into issues creating a Word document Word from Excel using

Set wordapp = CreateObject("word.Application")
Set letter = wordapp.Documents.Add

On first run it works fine, on second run it hangs. I think the issue is if I close the document I created using the Close Button in Word, it won't close WinWord.Exe. I think it has to do with whether I saved the document or not. How can I get around this?

I uninstalled/deactivated all of my Add-ins (I heard that could be an issue) to no avail.


回答1:


try closing and releasing the objects

Set wordapp = CreateObject("word.Application")
Set letter = wordapp.Documents.Add

'release the letter object
set letter = Nothing
'quit the word appication
wordApp.Quit
'release the app object
set wordapp = Nothing


来源:https://stackoverflow.com/questions/19913664/winword-exe-wont-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!