开发者

How to simulate a user pressing escape using the Excel COM interface?

开发者 https://www.devze.com 2023-01-21 09:01 出处:网络
I\'m working on an Excel add-in and I\'m using the Excel COM interface to do automate some testing.So I\'ll do something like (all through calls to the Excel COM interface开发者_StackOverflow中文版):

I'm working on an Excel add-in and I'm using the Excel COM interface to do automate some testing. So I'll do something like (all through calls to the Excel COM interface开发者_StackOverflow中文版):

  • Create a new Excel instance
  • Load my XLL add-in
  • Create a workbook
  • Set some worksheet formulae
  • Check that I get the expected results

Now I want to test that my add-in is correctly responding to user cancel requests, i.e. when the user presses escape while a function is calculating the function should abort.

How can I simulate a user pressing escape using the Excel COM interface?

I'm using Python to write my tests, but I don't think that's relevant.


If you don't mind using DDE, that would solve your problem. Another approach is to just write an xll to do it. http://kalx.net/xll is a libray that makes it easy to do this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号