Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JI JI is offline
external usenet poster
 
Posts: 4
Default How to detect "F2 key" event

I have create my own menu item. I want to disable it (I know how)
when the user editing cell (he pressed F2 key)
but I can´t find out how to detect this event.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default How to detect "F2 key" event

Look up Application.Onkey in the help menu. I think this will give you what
you need. Keep in mind that this is an application level setting so it exists
for the entire application, not just a specific book. And as always with
application level settings use an error handler to ensure that proper clean
up is done if something goes wrong.
--
HTH...

Jim Thomlinson


"ji" wrote:

I have create my own menu item. I want to disable it (I know how)
when the user editing cell (he pressed F2 key)
but I can´t find out how to detect this event.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to detect "F2 key" event

Just another thought:

I think the OP wants to disable the menu whenever the user is editing the
cell - F2 is just one method of going into edit mode and probably the least
likely to be used. Many people refer to editing a cell as F2. If my
interpretation is correct, then OnKey won't be sufficient.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Look up Application.Onkey in the help menu. I think this will give you

what
you need. Keep in mind that this is an application level setting so it

exists
for the entire application, not just a specific book. And as always with
application level settings use an error handler to ensure that proper

clean
up is done if something goes wrong.
--
HTH...

Jim Thomlinson


"ji" wrote:

I have create my own menu item. I want to disable it (I know how)
when the user editing cell (he pressed F2 key)
but I can´t find out how to detect this event.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default How to detect "F2 key" event

I thought the request was a little odd also. He asked about detecting F2 so I
gave him what he asked for. I showed him how to pull the trigger. I did not
worry too much about where he was pointing the gun. My assumption was the it
would be a learning experience. As always though... Good point!
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

Just another thought:

I think the OP wants to disable the menu whenever the user is editing the
cell - F2 is just one method of going into edit mode and probably the least
likely to be used. Many people refer to editing a cell as F2. If my
interpretation is correct, then OnKey won't be sufficient.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Look up Application.Onkey in the help menu. I think this will give you

what
you need. Keep in mind that this is an application level setting so it

exists
for the entire application, not just a specific book. And as always with
application level settings use an error handler to ensure that proper

clean
up is done if something goes wrong.
--
HTH...

Jim Thomlinson


"ji" wrote:

I have create my own menu item. I want to disable it (I know how)
when the user editing cell (he pressed F2 key)
but I can´t find out how to detect this event.




  #5   Report Post  
Posted to microsoft.public.excel.programming
JI JI is offline
external usenet poster
 
Posts: 4
Default How to detect "F2 key" event

Thanks for the information. I am newbee in Office Programming.
(I am writing windows programs in C++)
Back to my problem. All I need is to detect the situation when
the user editing the cell and then enable/disable my menu item
just as Excel enable/disables some menu items e.g. Open.
I don't want to change the functionality of F2 key.

Regards
ji


"Jim Thomlinson" wrote:

I thought the request was a little odd also. He asked about detecting F2 so I
gave him what he asked for. I showed him how to pull the trigger. I did not
worry too much about where he was pointing the gun. My assumption was the it
would be a learning experience. As always though... Good point!
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

Just another thought:

I think the OP wants to disable the menu whenever the user is editing the
cell - F2 is just one method of going into edit mode and probably the least
likely to be used. Many people refer to editing a cell as F2. If my
interpretation is correct, then OnKey won't be sufficient.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Look up Application.Onkey in the help menu. I think this will give you

what
you need. Keep in mind that this is an application level setting so it

exists
for the entire application, not just a specific book. And as always with
application level settings use an error handler to ensure that proper

clean
up is done if something goes wrong.
--
HTH...

Jim Thomlinson


"ji" wrote:

I have create my own menu item. I want to disable it (I know how)
when the user editing cell (he pressed F2 key)
but I can´t find out how to detect this event.






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
problem getting "detect and repair" to work in Excel 2003 ms Excel Discussion (Misc queries) 4 February 4th 10 02:39 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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

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

About Us

"It's about Microsoft Excel"