Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2005

Tip: Looking for answers? Try searching our database.

Run a Help file (.CHM) from VBA in an XL application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Russell - 31 Dec 2005 19:55 GMT
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
Jim Cone - 31 Dec 2005 20:57 GMT
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

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
Fred Russell - 31 Dec 2005 22:38 GMT
Thanks Jim, worked perfectly!

Best regards,
Fred
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.