473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MSProject Automation Too Slow

Hi All,

I have a requirement to Export a DataTable to MPP which i have achieved partially,my main concern in this process is *TIME TAKEN* for export,

I have a DataTable with 1500 rows which i have to export and to my shock it has taken 8 minutes to export this to MPP which is UNACCEPTABLE ,iam unable to solve this, need help,

Iam using the below code to add Tasks to the MPP



private void AddObjects(DataRow dRow, short outLineLevel, short prevOutLineLevel) {
try {
(this.msProj).Resources.Add("Temp", outLineLevel);
MSProject.Resource resource;
resource = this.msProj.Resources[outLineLevel];
MSProject.Task task;
this.msProj.Tasks.Add(dRow["TaskName"].ToString(), System.Reflection.Missing.Value);
this.msProj.Tasks[this.msProj.Tasks.Count].SetField(MSProject.PjField.pjTaskOutlineLevel, outLineLevel.ToString());
task = (((MSProject.Task)((MSProject.Tasks)((MSProject.Pr oject)this.msProj).Tasks)[this.msProj.Tasks.Count]));
DateTime plndStart = Convert.ToDateTime(dRow["PlannedStart"]);
DateTime plndEnd = Convert.ToDateTime(dRow["PlannedEnd"]);
if (!this.projApp.ActiveProject.BaseCalendars[1].Period(plndStart, plndStart).get_Working())
this.projApp.ActiveProject.BaseCalendars[1].Period(plndStart, plndStart).set_Working(true);
if (!this.projApp.ActiveProject.BaseCalendars[1].Period(plndEnd, plndEnd).get_Working())
this.projApp.ActiveProject.BaseCalendars[1].Period(plndEnd, plndEnd).set_Working(true);
task.Start = plndStart;
task.Finish = plndEnd;
task.Duration = dRow["Duration"];
task.ResourceNames = dRow["ResourceName"].ToString();
this.msProj.Tasks[this.msProj.Tasks.Count].SetField(MSProject.PjField.pjTaskOutlineLevel, outLineLevel.ToString());
DataRow[] rows = this.wbsDT.Select("ParentId=" + dRow["Id"]);
DataTable dt = new DataTable();
if (rows.Length > 0) {
for (int i = 0; i < rows.Length; i++) {
int index = prevOutLineLevel + 1;
AddObjects(rows[i], ((short)index), ((short)index));
}
}
}
catch (Exception ex) {
MessageBox.Show(ex.ToString());
}

}


Need Help,

Best Regards.
Dec 24 '07 #1
0 989

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Mark Day | last post by:
Hi All, I am using Access 2000 to generate over 40 Excel charts and pivot tables using early binding to the Excel 9.0 object library. I am finding that if I show the Excel object while processing...
21
by: Neil | last post by:
Is there a way to trap an error generated in another app that is controlled via automation? I have an Access 2000 app that opens Word 2000 and proceeds to open a series of documents and, in each...
0
by: Matt Harp | last post by:
I created a new Add-In project, and added a reference to the MSProject 11.0 Object Lib and everything compiles fine, until I try to access the Interop namespace. for this... using...
0
by: Prakash V via .NET 247 | last post by:
(Type your message here) Hi, I am trying to create a MSProject.Project object instance in VB .Net. this is the code I am using ...
0
by: Santhosh.A.N | last post by:
Hi, I have a problem to be solved yet. Following is the problem: I have a MSProject saved in SQLServer using ODBC, which automatically generates tables relevant to data. My requirement is to open...
2
by: Neil | last post by:
I have an Access 2000 mdb file which opens MS Word docs using automation. Our WAN is somewhat slow, and it takes about six seconds to open Word and the specified document (20 KB) from within Access...
0
by: bacchus | last post by:
i am converting a solution from vs2003 to vs 2005 and i need "interop.ms project.dll" or anything that can refrence msproject because this is the error i am getting when trying to build the...
0
by: Bullfrog | last post by:
My office application is really slow on Windows XP! First, some backgroud stuff. The MSAccess system that we use was developed while using Windows 2000, and Office 2000. At our new location,...
10
by: =?Utf-8?B?SGVyYg==?= | last post by:
In trying to write VB.Net code to control MSProject 2003 it was recommended that I record a macro in MSProject and transfer the code to VB.Net. When recording the FileSaveAs (to the project server)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.