How to reconstruct the Microsoft Project Task information to Excel sheet by VBA?
Hello.
I'm making a macro to reconstruct the Microsoft Project Document.
and I'm trying with VBA to resave the tasks matters that I want to show.
So I want to save Excel sheet through Microsoft Project Macro.
How can I solve this problem.
Thank you in advance. :rolleyes:
Re: How to reconstruct the Microsoft Project Task information to Excel sheet by VBA?
The first thing is in how to set the task. This is done using the Set keyword. Typically one sets a collection to all the tasks in the project, but it is possible to set it to some other task collection.
Here is an example of setting it to the tasks in the active project:
Dim ts as Tasks
Set ts = ActiveProject.Tasks
Using a Project object of some kind is essential to programming Project. Like the Task object, it is also a member of a collection, in this case it is part of the Projects collection. Although the Projects collection is under the Application it is what Microsoft calls a "top-level object" meaning that you can use it without needing to specify the Application. This means both of the following are equivalent within Project (though if you are controlling project from another application you will want to specify the application just to be clear):
Application.Projects
is the same as:
Projects
For more information on: How To Create an Excel Macro