Error 80010001 When C# App Launches MS Project

G

Greg Frazier

Veritest/LionBridge technicians are running test on one of my applications
that developed in c#, .NET 2.0, Visual Studio. They are testing it for Vista
and Office 2007 compatibility certification.

Their test sites are in France. They are encountering an 80010001 error
when the application attempts to launch MS Project 2007. I am unable to
replicate this error. The application has been loaded on four different
machines (Vista Business, Vista, Server 2003 and XP Professional) and it
successfully launches MS Project 2007.

But here is the error message the Veritest people are getting:

Unhandled Exception has occurred in your application. If you click Continue,
the application will ignore this error and attempt to continue. If you click
Quit, the application will close immediately.

Creating an instance of the COM component with CLSID
{36D27C48-A1E8-11D3-BA55-00C04F72F325} from the IClassFactory failed due to
the following error: 80010001

Has anyone ever encountered this problem? If so, what is the cause and
resolution.

Thank you.
 
G

Greg Frazier

This is additional info regarding my previous post: This is the code that
launches MS Project 2007. Is there a better, safer way to do this?

private void button1_Click(object sender, EventArgs e)
{
thermometer1.Value = 0;
tank1.Value = 0;
DateTime stDt = dateTimePicker3.Value;

string msProjectInstalled =
(string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\12.0\\Project\\InstallRoot", "Path", "NF");
if ((msProjectInstalled == "NF") || (msProjectInstalled == null))
{
MessageBox.Show("This feature requires Microsoft Project
2007. Please install this application first.", "MARS MS Project Exception");
return;
}

ApplicationClass app = new ApplicationClass();
app.AppMaximize();
app.FileNew(Missing.Value, Missing.Value, Missing.Value,
Missing.Value);

bool r = false;
int i = 1;
string vName = "Text1";
string vValue = "test";
string status = "";
string message = "";

statusStrip1.Text = "Please stand by ... creating production
schedule.";
this.Refresh();
Project prj = app.ActiveProject;

app.GanttBarStyleEdit("1",
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
3,
Missing.Value,
1,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value
);

app.SelectTaskColumn("Duration", Missing.Value, Missing.Value,
Missing.Value);
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Text2", "Part To Be Shipped", 12, 0, true,
true, 255, 1, 2, 1, Missing.Value, Missing.Value);
app.TableApply("&Entry");
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Text3", "Customer Name", 22, 0, true, true,
255, 1, 2, 1, Missing.Value, Missing.Value);
app.TableApply("&Entry");
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Text1", "Sales Document Number", 12, 0, true,
true, 255, 1, 2, 0, Missing.Value, Missing.Value);
app.TableApply("&Entry");
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Text6", "Task or Operation", 65, 0, true,
true, 255, 1, 2, 1, Missing.Value, Missing.Value);
app.TableApply("&Entry");

//app.SelectTaskColumn("Start", Missing.Value, Missing.Value,
Missing.Value);
app.SelectTaskColumn("Predecessors", Missing.Value,
Missing.Value, Missing.Value);
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Number2", "Accum. Total Per Job", 10, 2, true,
true, 255, 1, 8, 2, Missing.Value, Missing.Value);
app.TableApply("&Entry");
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Number1", "Daily Production Quantity", 10, 2,
true, true, 255, 1, 8, 2, Missing.Value, Missing.Value);
app.TableApply("&Entry");
//app.SelectTaskColumn("Resource Names", Missing.Value,
Missing.Value, Missing.Value);
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Flag1", "Scheduling Status", 10, 1, true,
true, 255, 1, 8, 1, Missing.Value, Missing.Value);
app.TableApply("&Entry");
//app.SelectTaskColumn("Predecessors", Missing.Value,
Missing.Value, Missing.Value);
app.TableEdit("&Entry", true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "Date1", "Required Ship Date", 12, 1, true,
true, 255, 1, 8, 1, Missing.Value, Missing.Value);
app.TableApply("&Entry");
app.SelectTaskColumn("Predecessors", Missing.Value,
Missing.Value, Missing.Value);
app.ColumnDelete();
app.SelectTaskColumn("Resource Names", Missing.Value,
Missing.Value, Missing.Value);
app.ColumnDelete();

app.DisplayPlanningWizard = false;
app.DisplayProjectGuide = false;
app.SetSplitBar(14);
app.Visible = true;

app.ProjectSummaryInfo(Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, stDt.ToShortDateString(), Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
app.ViewApply("Resource Gr&aph", Missing.Value, Missing.Value);
app.FilePageSetupHeader(Missing.Value, PjAlignment.pjCenter,
"Fabricum Corporation \n Production Capacity Resource Graph");
app.FilePageSetupFooter(Missing.Value, PjAlignment.pjLeft,
"prepared by Greg Frazier");
app.ViewApply("&Gantt Chart", Missing.Value, Missing.Value);

app.CustomFieldSetFormula(PjCustomField.pjCustomTaskFlag1,
"iif([Finish]>=[Date1],\"Yes\",\"No\")");
app.CustomFieldProperties(PjCustomField.pjCustomTaskFlag1,
PjCustomFieldAttribute.pjFieldAttributeFormula, PjSummaryCalc.pjCalcNone,
false, false);
/* CustomFieldIndicators FieldID:=pjCustomTaskFlag1,
SummaryInheritsNonsummary:=True, ProjectInheritsSummary:=True,
ShowToolTips:=True
CustomFieldIndicatorAdd FieldID:=pjCustomTaskFlag1,
Test:=pjCompareEquals, Value:="Yes", IndicatorID:=pjIndicatorFaceSadRed
CustomFieldProperties FieldID:=pjCustomTaskFlag1,
Attribute:=pjFieldAttributeFormula, SummaryCalc:=pjCalcNone,
GraphicalIndicators:=True, Required:=False */
app.CustomFieldIndicators(PjCustomField.pjCustomTaskFlag1, true,
true, true);
app.CustomFieldIndicatorAdd(PjCustomField.pjCustomTaskFlag1,
PjComparison.pjCompareEquals, "Yes", PjIndicator.pjIndicatorFaceSadRed,
PjCriteriaList.pjCriteriaNonSummary, Missing.Value);
app.CustomFieldProperties(PjCustomField.pjCustomTaskFlag1,
PjCustomFieldAttribute.pjFieldAttributeFormula, PjSummaryCalc.pjCalcNone,
true, false);
app.SetTitleRowHeight(6);

this.loadMSProjectSchedule(ref app, out status, out message);
if (status == "Abort")
{
statusStrip1.Text = "Process aborted!";
return;
}
this.levelTasks();

app.SelectTaskColumn("Name", Missing.Value, Missing.Value,
Missing.Value); // can't get this to work
app.ColumnDelete();

app.SelectCell(1, 2, 0);

statusStrip1.Text = "All done!";
}

If so, please provide examples.

Thanks.

Greg
 

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