求:VB ShellExecute时出错
代码:
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
ShellExecute Me.hWnd, "open", "http://www.baidu.com/", "", "", 1
错误提示:子程序或函数未定义。
请问是什么原因?
[解决办法]
我测试了,没有任何问题。可以直接打开百度网页。
Option Explicit
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 Sub Command1_Click()
ShellExecute Me.hWnd, "open", "http://www.baidu.com/", "", "", 1
End Sub