
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 0.80 KB | hits: 21 | expires: Never
VB6 Shell Function - Invalid procedure call or argument shell
Sub OpenTextFile(textfile$)
Dim txtapp$, arg$
txtapp = "Notepad.exe"
textfile = "C:UsersADMINDesktopUSA - FLNGmodeloutSUMMER.CFS"
arg = Trim$(txtapp & " " & Chr$(34) & Trim$(textfile) & Chr$(34))
ierr = Shell(arg, vbNormalFocus)
End Sub
Sub OpenTextFile(textfile As String)
Const txtapp As String = "Notepad.exe"
Dim arg As String
Dim ierr As Double
arg = Trim$(txtapp & " " & Chr$(34) & Trim$(textfile) & Chr$(34))
ierr = Shell#(arg, vbNormalFocus)
End Sub
Sub OpenTextFile(textfile As String)
Dim oShell As Object
Set oShell = GetShell
If Not oShell Is Nothing Then
oShell.Run textfile
End If
End Sub
Function GetShell() As Object
On Error Resume Next
Set GetShell = CreateObject("WScript.Shell")
End Function