Opening Help files in userforms in excel.
I have made an extensive program in excel using vba and the user for it is likely to require a help file so i made one and now i'm left with the problem of making it open the help file (i've only ever opened excel and microsoft word in via vba) and i can't seem to get it to work this is the basic outline of that part of my code.
Private Sub commandbutton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
TrapKey KeyCode, Shift
' This tells it to execute the help file
End Sub
(i have that for every component)
Sub TrapKey(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim Hname As Variant
If KeyCode = vbKeyF1 Then
'this code makes the help open if F1 is pressed
Hname = Application.GetOpenFilename("Help Files (*.hlp*),*.hlp*")
'i have no idea where the help file will be on their computer
'now to open the help file
End Sub
I have a method of saving where the help file is so that they only have to find it once.
So can anyone tell me how to open a help file?
Thanks for any help.
Re: Opening Help files in userforms in excel.
I think it would be easier if you created a hidden worksheet and input the help file there....label the sheet "HELP". Leave it hidden until the user clicks on a link to unhide the worksheet. That way the help file stays with the program you created.