开发者

How can I make the Excel cell menu update when the keyboard's context menu key is pressed

开发者 https://www.devze.com 2023-01-15 17:14 出处:网络
At the moment, I have code that runs in the Application\'s SheetBeforeRightClick event, but I\'ve found that this code doesn\'t run when I press the keybo开发者_StackOverfloward\'s Context Menu key in

At the moment, I have code that runs in the Application's SheetBeforeRightClick event, but I've found that this code doesn't run when I press the keybo开发者_StackOverfloward's Context Menu key instead of using the right mouse button, which means that I get the wrong menu.

I could use the SheetSelectionChange event instead, but I'd imagine this would be quite error prone. Is there a more elegant way of doing it?


There is a BeforeContextMenu event you can use.
http://msdn.microsoft.com/en-us/library/aa193082(office.11).aspx
It should catch both the right click and the keyboard key.

0

精彩评论

暂无评论...
验证码 换一张
取 消