|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
MSP Project Instance not getting closed
We are working on a web based application with IIS 5.0 as web server. There is a feature in our application where we need to integrate with Microsoft Project 2000 Service Release 1. We upload the contents of MPP file into our database at run-time from the path specified by the user.
To achieve this, we have created a VB COM component which uses Microsoft Project 9.0 Object libray. The ASP page then uses this VB COM dll to do the desired task. All this works fine on Windows XP. But on Windows 2000 Server (which is our deployment server), when the first time we access this ASP page to upload contents of MPP file to our database, things work fine. But second time onwards it does not work. Infact, IIS gets hanged and only option is to restart the server machines. The reason is that during the first access, the "winproj.exe" process does not get terminated. When we try to manually end this process from Task Manger, it does not allow, says "Access Denied". We also tried to kill this particuar process using "Kill.exe". But even Kill.exe is unable to kill this process. Also, the same code works fine on Win 2000 when we RUN it from VB or by making an EXE file. The MS Project instance (winproj.exe) gets closed with "prjApp.Quit". But when we make it as a DLL and call from asp page, it doesnt. Given below is the function that is written in the VB com to do the task (pls note that this code copies the contents of MPP file to an EXCEL file & then we read from the excel file to upload data into our database): Function MPP2XL(filename As String) On Error GoTo Err_Block Dim projfile As String ' other variables '.................................. '.................................. '.................................. Dim prjApp As New MSProject.Application Dim prjProject As MSProject.Project Dim xlapp As New Excel.Application Dim oBook As New Excel.Workbook Dim oWksht As Excel.Worksheet projfile = filename prjApp.FileOpen projfile & ".mpp" Set prjProject = prjApp.ActiveProject m_tasks = prjProject.Tasks.Count Set oBook = xlapp.Workbooks.Open(templet) Set oWksht = oBook.Worksheets.Item("Project_MilestoneTask") 'copying from MPP fle to EXcel file and saving the Excel file ------ this works fine. '................................... '.................................. '.................................. '.................................. Err_Block: Dim strMPP As String: strMPP = "" If Not oWksht Is Nothing Then Set oWksht = Nothing If Not oBook Is Nothing Then oBook.Close (False) Set oBook = Nothing End If If Not xlapp Is Nothing Then xlapp.Quit Set xlapp = Nothing End If If Not prjApp Is Nothing Then prjApp.FileClose pjDoNotSave prjApp.ActiveProject = Nothing prjApp.Quit Set prjProject = Nothing Set prjApp = Nothing End If End Function The problem is the code "prjApp.Quit" does not make the MS Project application quit in Win 2000 when the DLL is called from my ASP page. Also, the winproj.exe process could be killed from XP using the Task Manager but not in 2000 (could be a security feature???) Thanks Sushant |
|
#2
|
|||
|
|||
|
I have no idea on this one, sorry.
__________________
====== Doug G ====== "Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton |
|
#3
|
|||
|
|||
|
I tried the same code on Windows 2003 Server. There it worked fine. Could it be because of difference between security settings of these servers?
|
|
#4
|
|||
|
|||
|
I think that's likely. Permissions are at the bottom of many, many strange problems
![]() |
|
#5
|
|||
|
|||
|
same problem
Sushant Ji,
you had already the solution of this problem? I'm with the same error Rafa Last edited by bandit_br : May 20th, 2004 at 08:51 AM. |
|
#6
|
|||
|
|||
|
MSP Project Instance not getting closed
Quote:
Hello Sushanth, I am getting same problem on windows 2000 server with IIS 5.0. Is this problem is resolved on window 2000 server or did you find any other alternate. |
|
#7
|
|||
|
|||
|
can you provide me full source code of vb com component
that read a mpp file . thank you |
|
#8
|
|||
|
|||
|
I came up with a workaround for this problem. Instead of opening and closing an MS Project instance every time a request comes, I am using a single global instance stored in an application variable. I initialize this instance in global.asa file when application starts. Each request uses this very instance to upload data.
Since MS Project can have atmost one instance at anytime, I am also using a global flag (also initialized in global.asa) to check if one upload is already in progress. Downside of this workaround is that the process always remains in the memory but a huge upside is that it has saved us from buying a licence for a new Windows 2003 Server ![]() Hope this helps. |
![]() |
| Viewing: Dev Shed Forums > System Administration > IIS > MSP Project Instance not getting closed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|