By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Creaing an instance of MSProject.Project in VB .Net

P: n/a
(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
--------------------------------
From: Prakash V

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>hKUyWS/Xz0aJsPLXTutm2A==</Id>
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.