Check a Box and Press OK

I recently installed Excel 2011 and discovered that Microsoft didn’t let it completely bake before releasing it.
The issue at hand is that in the VBEditor>Preferences, when I check Require Variable Declaration (Option Explicit) it acts accordingly for the rest of the session, but (unlike other versions of Excel) forgets my preference when I exit Excel.

I’ve addressed this by writting a VBA routine that invokes the VBEditor Preference screen when Excel starts up (actually when the Personal Macro Workbook is opened). I then click the check-box, press OK and continue on.

I would like to automate that. Since the VBEditor is inaccesable to AppleScript (it’s barely availiable to VBA), i guess I’ll have to use GUI scripting.

So my quesion is; Given a dialog screen with the title “Preferences” how would one script setting the checkbox on that screen labeled “Require Variable Declaration” and then click the OK button?

Another approach might be to programaticaly “press” the Tab until the checkbox has the focus and then figure out how to check it with the “keyboard” etc. In VBA the command would be SendKeys, what is the AppleScript equvalent?

Thank you.

(Once this is done, I have to figure out the synchronicity issues between AppleScript and VBA).