Excel's macros are powerful programs that can enter a complex series of commands with a mere keystroke, but this power comes with some risks. Just imagine the damage a macro could do if it were designed to highlight a worksheet, delete everything on it, and then save the blank worksheet to disk. To prevent macros from running on your system without your permission, you can tighten Excel's macro security settings. These settings can warn you whenever you open a workbook that contains macros, so you can decide whether you want the workbook's macros to run. Caution | If you don't share workbooks or open workbooks from the Web, you don't need to worry about macro viruses. However, if you open workbooks you receive from friends , relatives, colleagues, or unknown sources, your system is at risk, even if you trust the person who sent you the workbook. | To change the macro security setting in Excel, follow these steps: -
Open the Tools menu, point to Macro , and click Security . The Security dialog box appears, as shown in Figure 13.10. Figure 13.10. Excel enables you to choose the desired macro security level. -
Click the desired macro security level: High to run only digitally signed macros from trusted sources. Medium to have Excel display a warning dialog box before you open a workbook file that contains macros. (You can then choose to disable macros for this workbook.) Low to have Excel open all workbooks without warning you about macro viruses. Choose this option only if you never open workbooks from outside sources or if you have a good antivirus program that can identify macro viruses. -
Click OK to save the security setting and close the Security dialog box. Tip | Macro security warnings are annoying. Install a good antivirus utility, such as Norton or McAfee AntiVirus, and choose the Low macro security level in Excel. | The Absolute Minimum When you find yourself frequently entering the same series of commands to perform the same task in Excel, that's a good sign that you need a macro. The next time you perform the task, record the steps, save the recording as a macro, and assign the macro to a keystroke or toolbar button. To play back the macro, simply press its keystroke or click its button. As you work with macros, keep the following in mind: To start recording a macro, open the Tools menu, point to Macro , and choose Record New Macro . When assigning a keystroke to a macro, hold down the Shift key while pressing one of the letter keys. You can play a macro by pressing its keystroke, clicking the button you created for it, or selecting it from a list of macros. To edit a macro, open the Tools menu, point to Macro , and click Macros . Click the name of the macro you want to edit, and click the Edit button. Macros can contain both commands and text. To prevent macro viruses from damaging your files and infecting your computer, set the macro security level to Medium or High , or install a good antivirus program. With the skills you acquired in this chapter, you can save a significant amount of time performing common, repetitive tasks . You can also secure Excel and your computer system from the outside threats posed by macro viruses. The next chapter focuses not on the threats posed by outside sources, but on the Excel features that enable you to share your worksheets on the Internet and access resources that are available there. | |