看看你的代码应该这样调用快捷方式: 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 LongPrivate Sub Command1_Click() ShellExecute Me.hwnd, "open", "e:\mylink.lnk", vbNullString, vbNullString, 1 End Sub
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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "open", "e:\mylink.lnk", vbNullString, vbNullString, 1
End Sub
请在形式上显示窗体之前,对窗体使用 Unload 语句或 Hide 方法。