问题
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