Excel.Interop DisplayAlerts to false does not handle everything

拟墨画扇 提交于 2019-12-11 16:27:14

问题


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."

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

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


回答1:


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

Take a look at the documentation here.

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).



来源:https://stackoverflow.com/questions/12629025/excel-interop-displayalerts-to-false-does-not-handle-everything

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