Google chrome 通过google Chrome访问box.com excel电子表格。弹出插件拦截器
我正试图通过excel上的一个按钮从box.com自动打开电子表格。代码执行如下,但是当代码试图按下“框编辑”按钮(小铅笔图形)时,Google Chrome会阻止“框编辑”打开电子表格。我已经尝试过摆脱弹出窗口拦截器的正常过程,即“始终允许此站点的弹出窗口”“在chrome设置下进入box.com”。在代码之外,当我手动拉框时,它会读到box.com是允许的,但由于某种原因,当代码执行时,它就像打开了一个带有原始设置的新chrome,因此阻止了插件。对于sendkeys,我提前表示歉意,因为它不熟悉selenium excel加载项。请帮助,从字面上看,代码按预期执行,但弹出窗口阻止程序不允许下载电子表格。谢谢大家!Google chrome 通过google Chrome访问box.com excel电子表格。弹出插件拦截器,google-chrome,excel,plugins,box,vba,Google Chrome,Excel,Plugins,Box,Vba,我正试图通过excel上的一个按钮从box.com自动打开电子表格。代码执行如下,但是当代码试图按下“框编辑”按钮(小铅笔图形)时,Google Chrome会阻止“框编辑”打开电子表格。我已经尝试过摆脱弹出窗口拦截器的正常过程,即“始终允许此站点的弹出窗口”“在chrome设置下进入box.com”。在代码之外,当我手动拉框时,它会读到box.com是允许的,但由于某种原因,当代码执行时,它就像打开了一个带有原始设置的新chrome,因此阻止了插件。对于sendkeys,我提前表示歉意,因为它
Sub openChrome()
Dim selenium As New SeleniumWrapper.WebDriver
Dim GC As Object
Dim intRowRowPosition As Integer
Dim keys As New SeleniumWrapper.keys
selenium.Start "chrome", "https://box.com/files/0/f/*********"
selenium.setTimeout ("120000")
selenium.setImplicitWait (5000)
selenium.Open ""
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "emailaddress", True
Application.SendKeys "{Tab}"
DoEvents
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "password", True
Application.SendKeys "{Return}"
DoEvents
Application.SendKeys ("{NUMLOCK}")
Application.Wait (Now + TimeValue("00:00:05"))
selenium.clickAndWait "id=preview_header_edit_btn"
End Sub
我找到了一个解决方法,并添加到我的代码中。(下文)
只是一个提醒。我想出了一个解决办法。在从box.com获取文件之前,我编写了一个宏来启用box.com插件。一个额外的层,但现在可以用了。
selenium.Start "chrome", "Chrome://plugins"
selenium.setTimeout ("120000")
selenium.setImplicitWait (5000)
selenium.Open ""
selenium.clickAndWait "id=npBoxEdit.dll-always-allowed"
Application.SendKeys "^l", True
DoEvents
Application.SendKeys "https://box.com/files/0/f/"
Application.SendKeys "{Return}"