Win-XP / Excel 2003 / VBA ….
I have the following piece of code to intercept all paste activities initiated by the user (main menu, context menu and control-V key) and send it to a Sub TrappedPaste()
....
Application.CommandBars("Edit").Controls("Paste").OnAction = "TrappedPaste"
Application.CommandBars("Edit").Controls("Paste Special...").OnAction = "TrappedPaste"
Application.CommandBars("Cell").Controls("Paste").OnAction = "TrappedPaste"
Application.CommandBars("Cell").Controls("Paste Special...").OnAction = "TrappedPaste"
Application.OnKey "^v", "TrappedPaste"
....
This code works fine. The miracle happened during worldwide rollout of the sheet, because “Edit” isn’t “Edit” and “Paste” isn’t “Paste” in German, French and all other languages between (A)leut and (Z)apotec :-O
Q:
- Is there a way of achieving
independence from the language of
the Excel User Interface, i.e. is
there a numeric aequivalent to the
“Paste” argument which is the same
in all national languages? - how can I find this number?
- is ctrl-V always ctrl-v in all local Windows languages?
Thanks in advance for any help
Kind regards MikeD
Each control on a toolbar has an
IDwhich can be used with theFindControlfunction:where
22is the ID of thePastebutton. As far as I was able to check, this number is the same accross different languages.So you can look them up in the English version and just hardcode them.