I'm using the ShellExecute API, but it is not opening any file with its associated program.
here is my coding:
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
Public Sub RunProgram(ByVal strProgram As String)
Dim lRet As Long
lRet = ShellExecute(vbNull, "Open", strProgram, "", "", 1)
If lRet <= 32 Then
MsgBox("Error Running Program")
End If
End Sub
Public Sub btmView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click
RunProgram(file_location)
end sub
It doesn't give me the error either. PLEASE HELP!
here is my coding:
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
Public Sub RunProgram(ByVal strProgram As String)
Dim lRet As Long
lRet = ShellExecute(vbNull, "Open", strProgram, "", "", 1)
If lRet <= 32 Then
MsgBox("Error Running Program")
End If
End Sub
Public Sub btmView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click
RunProgram(file_location)
end sub
It doesn't give me the error either. PLEASE HELP!