Creaing an instance of MSProject.Project in VB .Net

  • Thread starter Prakash V via .NET 247
  • Start date
P

Prakash V via .NET 247

(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

/*****************************************************************************/
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
line 1: Dim p As Object
line 2: Dim p1 As MSProject.Project
line 3: p = CreateObject("MSProject.Project")
line 4: p.Application.FileNew()
line 5: p1 = CType(p, MSProject.Project)
line 6: p1.Tasks.Add("test task on 21.04.2004")

line 7 : p1.SaveAs("d:\temp\testx.mpp", MSProject.PjFileFormat.pjMPP)
End Sub
/***************************************************************************/

I am trying to run the project and click the button i am getting the following exception at line 3
/*******************************************************************/
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in sample2.exe
Additional information: COM object with CLSID {1019A320-508A-11CF-A49D-00AA00574C74} is either not valid or not registered.
/*******************************************************************/

Please help for the above mention problem
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top