12.07.2015 Views

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Access<strong>in</strong>g <strong>Excel</strong> Functionality Us<strong>in</strong>g the C API 281Note: The trapped keyboard event is based on the physical keys pressed, as mapped forthe geographical sett<strong>in</strong>gs, rather than the character <strong>in</strong>terpreted by the operat<strong>in</strong>g system.For this reason, press<strong>in</strong>g the Caps Lock key is itself a keyboard event. Press<strong>in</strong>g, say, theA key will always return lowercase a regardless of the Caps Lock state. If you want totrap Ctrl-a you would pass the str<strong>in</strong>g “^a”. If you pass the str<strong>in</strong>g “^A” you will need topress Ctrl-Shift-a on the keyboard even if Caps Lock is set; <strong>in</strong> other words the str<strong>in</strong>gs“^A” and“^+a” are equivalent.8.14.5 Trapp<strong>in</strong>g a recalculation event: xlcOnRecalcOverview:Enumeration value:Callable from:Arguments:Instructs <strong>Excel</strong> to call a specified command whenever <strong>Excel</strong> isabout to recalculate the specified worksheet, provided that thisrecalculation is a result of the user press<strong>in</strong>g {<strong>F9</strong>} or theequivalent via <strong>Excel</strong>’s built-<strong>in</strong> dialogs, or as the result of achange <strong>in</strong> worksheet data. The command is not called where therecalculation is prompted by another command or macro. Unlikeother event traps, there can only be one trap for this event.32995 (x80e3)Commands only.1: SheetRef : A str<strong>in</strong>g of the format [Book1.xls]Sheet1specify<strong>in</strong>g the sheet to which the event applies.2: Command: The name of the command to be run as passed to<strong>Excel</strong> <strong>in</strong> the 4th argument to xlfRegister or the name ofsome other command macro or VB function.If SheetRef is miss<strong>in</strong>g, the command is run whenever this event occurs on any sheet.If Command is miss<strong>in</strong>g, the function clears the command associated with this comb<strong>in</strong>ationof event and sheet.8.14.6 Trapp<strong>in</strong>g a w<strong>in</strong>dow selection event: xlcOnW<strong>in</strong>dowOverview:Enumeration value:Callable from:Arguments:Instructs <strong>Excel</strong> to call a specified command whenever <strong>Excel</strong> isabout to switch to the specified worksheet. The command is notcalled where the switch is the result of actions of anothercommand or macro or as a result of a DDE <strong>in</strong>struction.32906 (x808a)Commands only.1: W<strong>in</strong>dowRef : A str<strong>in</strong>g of the format [Book1.xls]Sheet1[:n]specify<strong>in</strong>g the w<strong>in</strong>dow to which the event applies.2: Command: The name of the command to be run as passed to<strong>Excel</strong> <strong>in</strong> the 4th argument to xlfRegister or the name ofsome other command macro or VB function.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!