Hi Wendy,
I don't think possible directly, at least not in the same way as in theory
possible with a control in a form.
You might try something like the following to detect if F1 was pressed while
the button was in focus, in the sheet module -
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
Const cHelpID as long = 1100 ' help constant ID
If KeyCode = vbKeyF1 then
Call myHTMLhelp(cHelpID)
end if
End Sub
where myHTMLhelp is your routine to call the HTML help API (assuming you are
not using WinHelp)
Regards,
Peter T
"Wendy V" <(E-Mail Removed)> wrote in message
news:677D6D24-4E6C-4131-A8BD-(E-Mail Removed)...
> Is it possible to attach a custom help file to a CommandButton embedded in
an
> excel sheet so that when the button takes focus and I press F1, my custom
> help file pops up? I could not find the HelpContextID property for my
> command button.
>
> Wendy
> (Excel 2003, WinXP Pro)
|