I have a requirement to modify the ms project file (.mpp) using C#.net.
I have done with all the things, the only thing remaining is to modify the TimescaleStart date of MPP file using C#.net. I need to set the user defined date.
How can i do that?
Following is my code:
Microsoft.Office.Interop.MSProject.Application app = new Microsoft.Office.Interop.MSProject.Application();
app.DisplayAlerts = false;
app.AskToUpdateLinks = false;
app.FileOpenEx(
strFilePath + "test.mpp",
false,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
PjPoolOpen.pjPoolReadWrite, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Microsoft.Office.Interop.MSProject.Project pj = app.ActiveProject;
object objDate = dt.Date;
app.TimescaleStart = objDate;
Got Error as
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
on Following line:
app.TimescaleStart = objDate;