判断打开:http://www.foxtable.com/webhelp/topics/2126.htm
ShowAppWindow只能用来关闭指定标题的窗口,不是关闭文件或者应用程序的。
试试kill
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("某进程名称")
For Each p As System.Diagnostics.Process In ps
msgbox(p.MainWindowTitle)
p.kill
Next
个人的建议是提醒用户有打开的文件,让用户自己关闭文件,再重新移动