View Single Post
 
Old 02-13-2016, 10:28 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Option Explicit
#If VBA7 Then
  Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As LongPtr, _
                                               ByVal lpOperation As String, ByVal lpFile As String, _
                                               ByVal lpParameters As String, ByVal lpDirectory As String, _
                                               ByVal nShowCmd As Long) As LongPtr
#Else
  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
#End If
Public Sub NewShell(cmdLine As String)
  ShellExecute 1, "open", cmdLine, "", "", 1
lbl_Exit:
  Exit Sub
End Sub
Sub Test()
  NewShell "www.google.com"
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote