如何从Excel中的VBA代码调用IE'onblur'事件? [英] How do I invoke the IE 'onblur' event from VBA code in Excel?
本文介绍了如何从Excel中的VBA代码调用IE'onblur'事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
情况:我正在用Excel中的数据填充网页中的文本输入框.当手动输入数据并将焦点移至另一个文本框时,将触发"onblur"事件以进行输入验证.
Situation: I am working to populate text entry boxes in a webpage with data from Excel. When the data is entered manually and the focus is moved to another text box, the 'onblur' event is fired to do input validation.
期望:当我从Excel中的VBA代码填充相同的文本框时,我希望能够引发'onblur'事件.
Desire: I want to be able to cause the 'onblur' event to be fired when I populate the same text boxes from VBA code in Excel.
问题:如何使"onblur"事件执行?
Question: How do I cause the 'onblur' event to be executed?
推荐答案
我假设您可以访问DOM,在这种情况下,您应该可以使用
I'm assuming you have access to the DOM, in which case you should be able to use
document.getElementById(*element*).fireEvent("onblur");
这篇关于如何从Excel中的VBA代码调用IE'onblur'事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文