Newbie trying to create export macro's in Project 2003

S

Shan

Hi...

I'm tying to create a macro that will allow me to pull some custom
datasets from my Project 2003 file into Excel. I've tried all the
built in export functions and they don't generate the data in the same
layout and format that I require.

I want to generate a separate Excel file for each Resource, where the
Tasks for that resource are listed along with the Baseline
Start/Finish and Work, and the Actual Start/Finish and Work. I then
need to email these files out to their corresponding Resource
contacts.

Can anyone point me in the right direction on how to get started? I'm
very new at Project 2003 and macros, but have had a fair amount of
VB.NET programming experience.


Cheers,

Shan
 
J

Jan De Messemaeker

Hi Shan,

Alt+F11 leads you to the VB Editor allowing you to program in VBA
Object Browser gives help on all methods

To get you underway, here's a basic code to read each resource and its
tasks.
To achieve what you need you also have to build a link to the Excel objects:
-In the Editor, in Tools, References, check Microsoft Excel
Read the help on, the CreateObject and GetObject Methods

Sub TodolistsToXL()

Dim WorksForMe as resource
Dim WhataJob as task
Dim HeDidIt as assignment

for each worksforme in activeproject.resources
if not worksforme is nothing then
'Empty lines are read as nothing. this test should ALWAYS follow any For
stmt

...... Open or create the excel sheet
...... Handle the resource header

for each hedidit in worksforme.assignments
'No need for the Nothing test here as we read true objects
set whatajob=activeproject.tasks(hedidit.taskid)

'Now you have access to all task properties
'such as whatajob.name, whatajob.start etcetera

........ Write your task line in Excel

next hedidit

..... Closing routine for the resource
end if
Next worksforme

..... Closing of the procedure
End Sub

HTH
 

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