How to retrive Calendar variantions from Microsoft Project

G

gauravgoya

Hi Everyone
i am automating the Microsoft Project with another system. The
biggest problem i am facing is extracting variations from calendar.
I am able to get the variations to the calendar by going through each
day and checking if the day has different working timings than the
regular days. Although it works fine but it takes huge amount of time
going through each day.
so I was wondering is there any other way of getting the variations to
the calendar from Microsoft Project or some criteria which can make my
search faster.
Please let me know if any one has information regarding this matter.
Thank You.
Gaurav.
 
J

John

Hi Everyone
i am automating the Microsoft Project with another system. The
biggest problem i am facing is extracting variations from calendar.
I am able to get the variations to the calendar by going through each
day and checking if the day has different working timings than the
regular days. Although it works fine but it takes huge amount of time
going through each day.
so I was wondering is there any other way of getting the variations to
the calendar from Microsoft Project or some criteria which can make my
search faster.
Please let me know if any one has information regarding this matter.
Thank You.
Gaurav.

gauravgoya,
You don't mention how you are automating Project with the other system.
The working time information is available via VBA or through an SQL
query directly to the Project database. You can find more information
about the latter by searching your hard drive for the file: projdb.htm.

John
Project MVP
 
G

gauravgoya

Thank You John for acting on it so quick.
sorry for the insufficient information.
i am taking to the Microsoft objects using its disinterfaces. or
fvMSApplication := CreateOleObject('MSproject.Application');
ie. i am not getting data from database or xml.

My application has the similar objects as in the microsoft project. I
am populate my objects properties with Microsoft Project Objects
properties.
The application is really fast when i am getting project, task,
resource objects and its properties. but when it comes to the Calendar
object to get Variations to it i have to go thought loop which checks
if the day is different than the regular wroking calendar hours:

the loop is something like this:


LIDiff:=
DaysBetween(LMicrosoftProjectStartDate,LMicrosoftProjectStopDate);

for Ly:= 0 to LIDiff+1 do
begin
LDate:= LStartDate;
LDayOfTheWeek:= DayOfTheWeek(LDate);
DecodeDate(LDate,LStartOfYear,LStartOfMonth,LStartOfday);

LvDay:=
LvMicrosoftCalendar.Years[LStartOfYear].Months[LStartOfMonth].Days[LStartOfday];

{--Add Holidays--}
AddVariationIfMSDayIsHoliday(LvDay,LDayOfTheWeek,LDate); //This
function checks if the day is working or not
{--Add Exceptinal Working Days--}
AddVariationIfMSDayIsException(LvDay,LDayOfTheWeek,LDate); // This
function checks if the wroking day has differnt shift timings

LStartDate:= LStartDate + 1; //increment Date

end;

And to get working time information i am getting it by accessing
Microsoft SHIFT object from the Microsoft Day object.

Although this loop works but it takes tremendous amout of time as
every resorce also has calendar variations or exceptions and i need to
get them as well.
Thank again for your time.
I am only a junior programmes so in case if i have described something
wrong please let me know.

Thanks.
Gaurav
 
M

Mike Glen

Hi Gaurav,

You might like to try posting on the developer newsgroup. Please see FAQ
Item: 24. Project Newsgroups. FAQs, companion products and other useful
Project information can be seen at this web address:
http://project.mvps.org/faqs.htm

Mike Glen
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