如何以最快的方式关闭Internet Explorer对象? VBA

时间:2017-11-23 17:38:01

标签: vba internet-explorer

如何最好地关闭窗户? objectInternetExplorer.close不起作用并给我一个运行时错误'438':对象不支持此属性或方法。这是因为objectInternetExplorer是IE窗口而不是我发布的图像(您正在查看的网页正在尝试关闭标签页)。这是我的代码:

        objectInternetExplorer.Document.All.Item("submit.button").Click 'This clicks the submit button on the webpage
        Application.Wait (Now + TimeValue("0:00:02")): DoEvents 'Wait two seconds. 
        ''THEN VIEW THE IMAGE for the current point of the macro. "The Webpage you are viewing is trying to close the tab.
        SendKeys "{ENTER}", True 'To click OK 

Image: The webpage you are viewing is trying to close the tab. Do you want to close this tab?

0 个答案:

没有答案