The Shell command doesn't seem to work with a help file. What command will
run a help file and then return to the XL app?

Thanks,
Fred

Re: Run a Help file (.CHM) from VBA in an XL application by Jim

Jim
Sat Dec 31 14:57:48 CST 2005

Fred,

I wish Rob Bruce would show up in these groups more often...
'----------------------
'Rob Bruce - public.excel.programming - 05/26/2005
'If you use the shellexecute API you don't need to know anything about the app:
'(just the file path and file, as the API determines the program to use - JBC)

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 OpenFileInDefaultApp(FullName As String)
ShellExecute 0, vbNullString, FullName, 0&, 0&, 1
End Sub

Sub test()
OpenFileInDefaultApp "C:\WINDOWS\Help\iexplore.chm" 'JBC
End Sub
'-------------------------------

Regards,
Jim Cone
San Francisco, USA


"Fred Russell" <frussell@msn.com> wrote in message news:ukKLsQkDGHA.748@TK2MSFTNGP12.phx.gbl...
The Shell command doesn't seem to work with a help file. What command will
run a help file and then return to the XL app?
Thanks,
Fred



Re: Run a Help file (.CHM) from VBA in an XL application by Fred

Fred
Sat Dec 31 16:38:38 CST 2005

Thanks Jim, worked perfectly!

Best regards,
Fred