【发布时间】: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