Help Using the On Key command in Excel

Hey all,

Noobie to applescripting.

I am using excel 2004 and would like to either:

Find a way to remove the default function keys from certain commands (ie in Word, when you click on Tools/Customize Keyboard, you can remove certain short cuts from commands by clicking the Remove button; in Excel, this option is greyed out)

or

I would like to use the On Key command to assign the following process to the F2 key:

	tell application "System Events" to tell process "Microsoft Excel"
		keystroke "u" using control down

My entire script looks like this but i know the On Key command is incomplete. I keep getting a “Can’t continue on key error” no matter how i script it. I just cant figure it out:

tell application "Microsoft Excel"
	activate
	activate current page
	on key key "{F2}"
	tell application "System Events" to tell process "Microsoft Excel"
		keystroke "u" using control down
	end tell
end tell

Any help on either would be much appreciated.

Does anyone have any experience in applescript using the On Key command in excel? For the life of me I cannot get it to work, even with a simple code. I always get an error that says, “Can’t continue on key.” I have tried everything. I have looked at various VBA boards since the excel applescript is very similar. But no luck. Any help, even if someone could test a script that works, would be immensely appreciated.

Hi! I am having exactly the same problem. Have you found a solution?

Any directions will be greatly appreciated!

No i havent. very surprised no one has an answer or has any idea what the On Key command is not working…

Anyone?

Maybe i should post a small reward for solving… :slight_smile: