Chapter 27. Automating Your Work with Macros

One of the easiest ways to increase your day-to-day productivity with Microsoft Office Project 2007 is to use macros. Macros can automate repetitive, tedious, or complex tasks, freeing your time for more important tasks such as managing your projects.

This chapter focuses on macros you might use to automate tasks that you need to do frequently. Typically, macros are created by recording the steps in a task, which means that little (if any) programming is required.

Understanding Macros

Washing the dishes—what a chore. Pick up a dirty plate, wash it with soapy water, rinse it off, and then dry it. It’s the same every time. But with a dishwasher, all the tedium of washing, rinsing, and drying is automatically handled by the machine, leaving you free to do better things with your time. Similarly, you don’t want to perform the same tedious series of commands week after week; you just want a specially formatted report to print every Friday. What you need is a macro.

What Is a Macro?

Basically, a macro is a shortcut that performs a series of commands. Rather than manually performing each step necessary to complete a task, you simply tell the software what each step is, what needs to be accomplished in each step, and in what order the steps must occur. Then you designate some way to set this series of commands in motion.

To do this in Office Project 2007, you have Microsoft Visual Basic for Applications (VBA), a macro language that is not only powerful but easy to understand and use. A subset of the highly popular Microsoft Visual Basic programming language, VBA is both powerful and easy to understand. What’s more, the tools available in Project 2007 make creating macros as easy as can be. Most macros can be created without ever seeing, much less writing, VBA code.

Why Use Macros?

When you use Microsoft Project (or any other business productivity software), you use it because it makes doing your job easier and more efficient. One of the reasons that software can make you more productive is that the features it has are, in a sense, a collection of macros that accomplish tasks that the software designers feel can be accomplished more effectively by using a computer. More importantly for this discussion, these "macros" perform tasks that the designers learned their customers want. But what the designers can’t do is create all the features that every customer wants. This is where macros can prove so useful.

Because individual users can create a macro to accomplish some particular task, you can essentially customize the software by adding features that support the particular way you do your job.

For example, let’s say that you do have to print a certain report every Friday. Before you can print anything, you have to do the following:

  1. Choose the right view of your project data.

  2. Choose among several filters to exclude unwanted tasks.

  3. Choose how you will sort the data.

  4. Choose the report format you need.

After you open the right project, you might have to click your mouse well over a dozen times before you can print the report. With a macro to perform all those steps for you, printing the report would be reduced to only a few mouse clicks.

Just because macros can be used to perform a complex series of steps doesn’t mean that every macro has to be elaborate. Maybe you have certain simple things you do in Microsoft Project all the time, such as creating work breakdown structure (WBS) code masks. By recording a macro and creating a new toolbar button for it, you have a convenient one-click method for opening the WBS Code Definition dialog box.

Note

For more information about creating new toolbar buttons to run macros, see the section titled Creating Toolbar Buttons later in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.140.134