【问题标题】:How to use Excel to open a new URL in an opened Chrome tab without opening a new tab如何使用 Excel 在打开的 Chrome 选项卡中打开新 URL 而无需打开新选项卡
【发布时间】:2014-01-10 23:00:08
【问题描述】:

我在 Excel 电子表格中有两个按钮。当我点击 button1 时,Chrome 会打开一个新标签页,但是当我点击 button2 时,Chrome 会打开另一个标签页。

我想要的是当我单击 button2 时,使用 button1 打开的 Chrome 选项卡将通过刷新第一个选项卡中的 URL 来访问 button2 的 URL,而不是创建新选项卡。谢谢!

Private Sub Button1_Click()
    chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""
    Shell (chromePath & " -url http:abc.com")
End Sub

Private Sub CommandButton2_Click()
    chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""
    Shell (chromePath & " -url http:def.com")
End Sub

【问题讨论】:

    标签: vba google-chrome url excel


    【解决方案1】:

    查看Selenium VBA。也许使用 switchTo() 方法可以将 Selenium 的焦点设置为打开的 Chrome 窗口,然后可以像往常一样使用其他 Selenium 方法自动执行此操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-03
      • 1970-01-01
      • 2012-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多