Excel.Interop DisplayAlerts为false不能处理所有问题 [英] Excel.Interop DisplayAlerts to false does not handle everything

查看:98
本文介绍了Excel.Interop DisplayAlerts为false不能处理所有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我尝试过在这里找到它,但是没有运气.我遇到的问题是,当两个程序试图同时保存,关闭或与单个excel工作簿进行交互时,都会出现一个对话框.

Ok i tried looking on here to find this before, but no luck. The problem I'm having is when two programs try to either save, close, or interact in anyway with a single excel workbook at the same time a dialog box appears.

对话框中显示类似"[文件路径]当前正在使用,无法访问."

The dialog boxes says something like "[file path] Is currently in use and can not be accessed."

我已将DisplayAlerts设置为false,但不会捕获此错误.

I have DisplayAlerts set to false, but it will not catch this.

还有其他人有这个问题并且有可行的解决方案吗?

Has anyone else had this problem and have a viable solution?

推荐答案

当前正在使用该文件的原因是OS将该文件而不是Excel本身抛出的.

The file is currently in use is due to OS throwing it up rather than Excel (by itself).

看看文档这里.

据我了解,Excel可以控制在Excel正常工作期间显示的警报(例如,不保存就关闭文件会抛出一个对话框,可以使用DisplayAlerts阻止该对话框显示).

From what I understand, Excel can control alerts that show up during regular working of Excel (such as closing file without saving throws up a dialog, which can be prevented from showing up using DisplayAlerts).

这篇关于Excel.Interop DisplayAlerts为false不能处理所有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆