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
Const SW_SHOWMAXIMIZED = 3
Private Sub List1_DblClick()
If List1.Text <> "" Then
ShellExecute Me.hwnd, "open", "d:\cw\" & List1.Text, "", "", SW_SHOWMAXIMIZED
End If
End Sub
用shell打开excel文件?
Private Sub List1_DblClick()
Shell "d:\cw\" & List1.List(List1.ListIndex)
End Sub
Private Sub Command4_Click()
Dim ExcelApp As Object
Set ExcelApp = CreateObject("excel.application")
ExcelApp.Workbooks.Add "d:/1.xls"
ExcelApp.Visible = True
End Sub