View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andrew Hall NZ Andrew Hall NZ is offline
external usenet poster
 
Posts: 21
Default Problem with Shell command


I have partially answered my question, but I would still be interested in
why the simpler Shell command does not work. The following works

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

Sub OpenFile()
Dim file As String
file = "C:\vba\copy7.htm"
Call ShellExecute(0&, vbNullString, file, _
vbNullString, vbNullString, vbNormalFocus)
End Sub