By using t2do.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

T2Do.com

 


RunProgram

Sub RunProgram(sFile, Optional args, Optional runInFolder)
'Version: 1.000
'Purpose: This run passed sFile
  Dim RetVal As Long
  On Error Resume Next
  RetVal = ShellExecute(0, "open", sFile, "", "", SW_SHOWMAXIMIZED)
End Sub




'Below to be copied to a Module's declaration section

Public 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 Enum ShowWindowCommands
        SW_HIDE = 0
        SW_SHOWNORMAL = 1
        SW_NORMAL = 1
        SW_SHOWMINIMIZED = 2
        SW_SHOWMAXIMIZED = 3
        SW_MAXIMIZE = 3
        SW_SHOWNOACTIVATE = 4
        SW_SHOW = 5
        SW_MINIMIZE = 6
        SW_SHOWMINNOACTIVE = 7
        SW_SHOWNA = 8
        SW_RESTORE = 9
        SW_SHOWDEFAULT = 10
        SW_FORCEMINIMIZE = 11
        SW_MAX = 11
    End Enum