如何关闭由邮件合并启动的 Excel 实例
如何关闭通过邮件合并启动的 Excel 实例
在启动器内运行的此代码无法访问通过 DDE 运行的 Excel?
'For i = 1 To Workbooks.Count
' MsgBox ("here" + Workbooks(i).Name)
'If (Workbooks(i).Name <> ActiveWorkbook.Name) Then
'Workbooks(i).Close
'End If
'Next i
HOW TO close Excel instance started by mail merge
this code running inside launcher does not have access to Excel running via DDE ??
'For i = 1 To Workbooks.Count
' MsgBox ("here" + Workbooks(i).Name)
'If (Workbooks(i).Name <> ActiveWorkbook.Name) Then
'Workbooks(i).Close
'End If
'Next i
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以像这样终止Excel进程:(来自 http://www.dreamincode.net/code /snippet1543.htm)
You can kill the excel process like so: (from http://www.dreamincode.net/code/snippet1543.htm)
如果从 Excel 内部调用,则可以通过 VBA 关闭 Excel
如果从 Excel 外部调用,则需要设置对 Excel 的引用,然后将其关闭。
您需要确保所有工作簿都已关闭或保存,否则Excel将提示用户保存。
Excel can be closed via VBA, if called from within Excel
If called from outside Excel, you will need to set a reference to Excel and then close it.
You need to ensure that all Workbooks are closed or saved, otherwise Excel will prompt the user to save.