Click here to Skip to main content
15,913,685 members

Comments by KalpanaGupta28 (Top 4 by date)

KalpanaGupta28 17-Apr-17 0:18am View    
Thank you. But I have initialized the projApp still getting the same error. Please see below code

using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using MSProject = Microsoft.Office.Interop.MSProject;

namespace MPP
{
public class MPPClass
{

object fileMpp = "C:\\Test.mpp";
object readOnly = false;

MSProject.Application projApp = new MSProject.Application();

projApp.FileOpen(fileMpp, true);
MSProject.Project proj = projApp.ActiveProject;


}

}
KalpanaGupta28 14-Apr-17 6:14am View    
NightWizzard : I have updated my question. Please check and help me.
KalpanaGupta28 14-Apr-17 5:51am View    
yes.
my code is like this. I am getting error "projApp.FileOpen does not exists in the current context"

projApp.FileOpen(fileMpp, true);


**********Code :**********
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using MSProject = Microsoft.Office.Interop.MSProject;

namespace MPP
{
public class MPPClass
{

object fileMpp = "C:\\Test.mpp";
object readOnly = false;
//object missing = System.Reflection.Missing.Value;

MSProject.Application projApp = new MSProject.Application();
projApp.FileOpen(fileMpp, true);
MSProject.Project proj = projApp.ActiveProject;

MSProject.Project currProject = null;
MSProject.Selection selection = null;
MSProject.Tasks selectedTasks = null;
MSProject.Task pjTask = null;
currProject = MSProjectApp.ActiveProject;
selection = MSProjectApp.ActiveSelection;
selectedTasks = selection.Tasks;

}

}
KalpanaGupta28 14-Apr-17 0:43am View    
I am getting error as "appclass doesnot exist in the current context"
appclass.FileOpen(fileName, readOnly, merge, missing, missing, missing, missing, missing, missing, missing, missing, pool, missing, missing, ignoreReadOnlyRecommended, missing);