如何判断Excel应用程序是否处于单元格编辑模式? [英] How to tell if Excel Application is in cell-edit mode?
问题描述
任何想法? / p>
有一个Application.Ready属性应该给你这个信息,但实际上它不能可靠地工作。请参阅此处以获取解决方案。
您可能还需要查看设置Application.Interactive = false,而.net代码正在执行其中的任何操作。
I'm writing an Excel Addin using COM Interop from .net. I have a command that pops up a dialog, and from the dialog I do some work like collecting data from the used range of several sheets. The problem is that if a cell is in edit mode, some of the calls that I need to make will throw exceptions. I would like a way of determining before-hand that Excel is in edit mode, so that I can warn the user to finish editing the cell first.
Any ideas?
There is an Application.Ready property that is supposed to give you this information but in practice it doesn't work reliably. See here for a hackaround.
You might also want to look at setting Application.Interactive=false while your .net code is doing its stuff.
这篇关于如何判断Excel应用程序是否处于单元格编辑模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!