★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★打开网站1
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOW = 5
'声明
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOW = 5
'声明
Dim web1 As String
web1="www.hao123.com"
ShellExecute 0&, vbNullString, web1, vbNullString, vbNullString, 0
Exit Sub
'启动
'★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★打开网站
ShellExecute 0&, vbNullString, www.hao123.com, vbNullString, vbNullString, 0'方法二
以上方法1在打开第二个网站时会关闭之前打开的网页
方法二则打开第二个不会对之前打开的网页有影响,自已选择哦
本文介绍了使用VBA通过两种不同方法打开网站的技术细节。一种方法会在打开新网站时关闭之前的页面,而另一种方法则允许同时打开多个网站而不互相影响。

4481

被折叠的 条评论
为什么被折叠?



