Creating a project with ASP...

C

Curtis Tammany

Hello-
Through ASP I'm trying to create a blank project, add tasks to it and then save it. If I don't add any tasks to the project, I can save an empty project to file BUT as soon as I add tasks to the project- it hangs when trying to save the project to file. Here's the code so far:

<html>
<head>
<title></title>
</head>
<body>

<%
server.ScriptTimeout = 30
Set prjApp = CreateObject("MSProject.Project")

Set prjProject = prjApp.Application.Projects.Add(False,"", False)
prjProject.Activate

'Add tasks to the project.
For intTask = 1 To 10
prjProject.Tasks.Add("Task Number " & intTask)
Next

'Read the tasks
For i=1 to prjProject.Tasks.count
response.Write prjProject.Tasks(i).Name & " - " & prjProject.Tasks(i).UniqueID & "<BR>"
Next
response.Write "There are " & prjproject.tasks.count & " tasks.<BR><BR>"
response.flush

response.Write "Trying to save the file....<BR>"
response.flush
prjApp.Application.FileSaveAs "C:\DATA\WWW\exp_menu13\test.mpp", 0
prjApp.Application.FileCloseAll 0
prjApp.Application.Quit 0
response.Write "Saved the file....<BR>"

Set prjProject = Nothing
Set prjApp = Nothing
response.Write "Closed the Project object.<BR>"
%>
</body>
</html>
Any body know why it hangs???

Thanks!!!
Curtis
 

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

Top