Eric's Webspace
Pong for Microsoft Excel 97
Download Now!
This is a VBA module that can be dropped into any Excel97 spreadsheet to give it single-player Pong-playing capability.  This was done just because it can be done. What other reason is there? This is NOT for Excel 2000 because it has other ways of doing this (which I haven't bothered to investigate).

As it is currently written, pressing the "F12" key starts Pong, and pressing the "Escape" key stops Pong. The right and left arrow keys move your paddle. If you hit the ball with the side of the paddle, you change the angle of the resulting bounce. You get a "beep" if you miss the ball. I usually miss, so I hear lots of beeps. Because I miss so much, I decided Pong wouldn't keep score. The longest recorded time before becoming bored with the game is 45 seconds. Pong doesn't affect any data on your spreadsheet.

Here's how to add the pong module into your spreadsheet.  Here's the actual pong module you'll need (you might have to right-click or shift-click it). If you don't want to add Pong to one of your spreadsheets, here's a blank spreadsheet with the pong module already installed. If you click the "Download Now" icon at the top of the page, you get both the separate module and the installed spreadsheet together in a zip file. 

Although the web isn't the place to try to demo "high-speed" action games, the animated picture below should give you some small idea of what the game looks like. 


This is actually a demo of how to use callbacks from inside VBA. You aren't actually supposed to be able to do it! Excel 97 VBA doesn't support the "AddressOf" function, and without it you can't find the address of a function for a callback. Of course, there is always a low-level undocumented workaround! Here I use a Windows timer API function and convince it to call back to one of my routines so I can move the pong ball every few milliseconds.

Lost? Look at the site map.

Bad links? Questions? Send me mail.

Google
Yahoo
Ask Jeeves