O'Reilly logo

Excel 2010: The Missing Manual by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Macro Security

Excel's macro language is surprisingly powerful. In fact, the VBA language packs enough power for expert gurus and hackers who want to design malicious worksheet viruses. Unfortunately, macros aren't limited to moving from cell to cell, entering information, formatting data, and so on. Instead, macros can use full-fledged VBA code (which you'll consider in the next chapter) to delete files and even lobotomize your operating system.

Note

Excel macro viruses are adept at spreading—they work by copying themselves from an infected workbook to other currently open workbooks. But only a few Excel viruses exist, and almost none of them are destructive. They may annoy you, but they aren't likely to trash your computer. You can find a catalog of macro viruses that affect Office programs at http://tinyurl.com/lgmls.

To keep your machine clean, the best solution is to avoid using macros in Excel spreadsheets that you don't trust. (And if you do get infected, antivirus software can help you out.) Happily, Excel's got your back—whenever you open a macro-enabled workbook, Excel automatically disables all the macros it contains. In fact, this is even true for the workbooks you create.

To see Excel's automatic security in action, try this test. Create a new workbook (or open an existing one), record a macro, save the workbook (as a .xlsm or .xlsb file), and close it. Now try opening it again. Excel automatically disables the macro you created and pops open a message bar that explains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required