473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Creaing an instance of MSProject.Project in VB .Net

(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
0 1138

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: kon george | last post by:
Can somebody assist. I build this code on a dev laptop and copied across the entire code to a Windows 2003 server with 1.1 framework. It is basic ASP.NE T that uses web service for SQL Server...
2
by: Seth | last post by:
Hi all, I am trying to get MS Project to create and save data back to DB2 via the IBM ODBC driver. Both MSSQL and Oracle work, but when saving back to DB2 it crashes leaving the DB with only...
0
by: Matt Harp | last post by:
I created a new Add-In project, and added a reference to the MSProject 11.0 Object Lib and everything compiles fine, until I try to access the Interop namespace. for this... using...
0
by: bacchus | last post by:
i am converting a solution from vs2003 to vs 2005 and i need "interop.ms project.dll" or anything that can refrence msproject because this is the error i am getting when trying to build the...
0
by: mfleet1973 | last post by:
Hi Gang. Is it possible to export/import data from/to MsProject? If it is, can someone please guide me in the right direction? Thanks a lot! Mike.
0
by: pankajprakash | last post by:
as i run the my web application it occurs the following error "Could not load file or assembly 'Microsoft.Office.Interop.MSProject, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'...
2
suryasreepada
by: suryasreepada | last post by:
I have been searching for tools required develop MSProject 2007 Add-in. But I did not find any tools for this. Please help me by providing any simple samples and What are the tools required to...
0
by: ansu832001 | last post by:
Hi All, I have a requirement to Export a DataTable to MPP which i have achieved partially,my main concern in this process is *TIME TAKEN* for export, I have a DataTable with 1500 rows which i...
10
by: =?Utf-8?B?SGVyYg==?= | last post by:
In trying to write VB.Net code to control MSProject 2003 it was recommended that I record a macro in MSProject and transfer the code to VB.Net. When recording the FileSaveAs (to the project server)...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.