用VISUAL STUDIO VB环境 在窗体上按装一个按钮,点击打开指定路径的一个EXCEL文件,该如何操作?

2025-03-25 09:46:11
推荐回答(1个)
回答1:

VBA中调用API函数,VB中应该一样的

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 Command4_Click()

ShellExecute hWnd, "open", "路径", vbNullString, vbNullString, 0