General Macro Q

J

JCG

I've used MS Project for several years and consider myself proficient with
it. However, I've never created a macro or used VBA.

I import multiple MS Project files that are maintained by end users with
limited MS Project skills. Therefore, minimal information is maintained as
it is difficult to, say, ask them to rollup specific tasks to the summary.

Upon opening the masterfile, I want to have a macro search all tasks named
"Design" and check the "Rollup Gantt Bar to Summary".

Is it possible for someone to provide me the sample code to complete the
above macro.
 
J

John

JCG said:
I've used MS Project for several years and consider myself proficient with
it. However, I've never created a macro or used VBA.

I import multiple MS Project files that are maintained by end users with
limited MS Project skills. Therefore, minimal information is maintained as
it is difficult to, say, ask them to rollup specific tasks to the summary.

Upon opening the masterfile, I want to have a macro search all tasks named
"Design" and check the "Rollup Gantt Bar to Summary".

Is it possible for someone to provide me the sample code to complete the
above macro.

JCG,
Probably the best way to get started with VBA is to record a macro of
you doing something. For example, in your case go to Tools/Macro/Record
New Macro. A Record Macro window will pop up giving you some information
about the macro you are about to create. Then apply a filter, which you
can either create right then, (the recorder will create the code for
filter creation), or use a filter you already created to filter out
tasks named "Design". Next, select all tasks and go to Project/Task
Information/General. Select the "Roll up Gantt bar to summary" option
and close. Finally, stop the macro recorder.

To view the code you just recorded, go to Tools/Macro/Macros and select
Macro1. Then hit "Edit". Once you have the basic code, you can make
modifications to it as desired. If you want to learn more about VBA,
there is an excellent free tutorial that can be found on our MVP website
at: http://www.mvps.org/project/links.htm
At the very bottom of the page you will find a link to, "Project 98
Visual Basic Environment Training Materials". Although it says it is for
Project 98, it is equally applicable to all current versions of Project.
The only real difference is that each new version of Project normally
adds more methods, properties, etc. to the Project object library.

Of course once you get some code set up and have questions, post on this
newsgroup and we will be glad to help.

John
Project MVP
 
M

Mike Glen

Hi JCG,

Also, you might like to have a look at my series on Microsoft Project in the
TechTrax ezine, particularly #16 on Macros, at this site:
http://tinyurl.com/2xbhc or this:
http://pubs.logicalexpressions.com/Pub0009/LPMFrame.asp?CMD=ArticleSearch&AUTH=23
(Perhaps you'd care to rate the article before leaving the site, :)
Thanks.)

FAQs, companion products and other useful Project information can be seen at
this web address: <http://www.mvps.org/project/>

Hope this helps - please let us know how you get on :)

Mike Glen
MS Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top