Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Custom help attached to CommandButton

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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Custom help attached to CommandButton

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" wrote in message
...
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)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't find Custom Toolbar attached to workbook Woodsman Excel Programming 1 August 15th 07 04:21 PM
How do I make a commandbutton in Excel 'launch' a custom form? chorismos Excel Programming 2 October 12th 06 04:12 PM
How can I update a Attached Custom Toolbar in a shared file? follyman Excel Worksheet Functions 1 September 2nd 06 03:40 AM
Accessing Attached XLS file shannyshanhan Excel Worksheet Functions 0 August 9th 06 02:57 AM
Attached tool bars WISE Excel Discussion (Misc queries) 3 February 14th 06 01:06 AM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"