S
Scott
Hi,
I have code in vb.net that saves project server files to a file server. It
was working fine, untill I introduced some code to create a new folder. Now
my application object has lost it's connection to the server. It thinks it's
working offline.
As soon as I start working with the filesystemobject, project server goes
offline.
Is there a way to tell my application object to use the server to open files?
Here's a snippet of my code.
___________________________________________________________________
Dim pApp As Microsoft.Office.Interop.MSProject.Application
Dim fso As Scripting.FileSystemObject, fldr As Scripting.Folder, fileName As
String
Dim folderName As String, reportingDate As Date
fso = CreateObject("Scripting.FileSystemObject")
reportingDate = Now
folderName = "\\Project Management\older_versions\" & reportingDate.Month &
"_" & reportingDate.Day & "_" & reportingDate.Year
If Not fso.FolderExists(folderName) Then
fldr = fso.CreateFolder(folderName)
Else
folderName = Trim(folderName) & "_" & reportingDate.Hour & "_" &
reportingDate.Minute
fldr = fso.CreateFolder(folderName)
End If
fileName = fldr.Path & "\test.mpp"
pApp = CreateObject("msproject.application")
pApp.Visible = True
pApp.FileOpen(Name:="<>\test.Published")
If fso.FileExists("\\Pegasus\AllAccess\Project Management\test.mpp") Then
fso.DeleteFile("\\Pegasus\AllAccess\Project Management\test.mpp", True)
End If
pApp.FileSaveAs(Name:="\\Pegasus\AllAccess\Project Management\test.mpp",
FormatID:="MSProject.MPP")
pApp.FileClose()
I have code in vb.net that saves project server files to a file server. It
was working fine, untill I introduced some code to create a new folder. Now
my application object has lost it's connection to the server. It thinks it's
working offline.
As soon as I start working with the filesystemobject, project server goes
offline.
Is there a way to tell my application object to use the server to open files?
Here's a snippet of my code.
___________________________________________________________________
Dim pApp As Microsoft.Office.Interop.MSProject.Application
Dim fso As Scripting.FileSystemObject, fldr As Scripting.Folder, fileName As
String
Dim folderName As String, reportingDate As Date
fso = CreateObject("Scripting.FileSystemObject")
reportingDate = Now
folderName = "\\Project Management\older_versions\" & reportingDate.Month &
"_" & reportingDate.Day & "_" & reportingDate.Year
If Not fso.FolderExists(folderName) Then
fldr = fso.CreateFolder(folderName)
Else
folderName = Trim(folderName) & "_" & reportingDate.Hour & "_" &
reportingDate.Minute
fldr = fso.CreateFolder(folderName)
End If
fileName = fldr.Path & "\test.mpp"
pApp = CreateObject("msproject.application")
pApp.Visible = True
pApp.FileOpen(Name:="<>\test.Published")
If fso.FileExists("\\Pegasus\AllAccess\Project Management\test.mpp") Then
fso.DeleteFile("\\Pegasus\AllAccess\Project Management\test.mpp", True)
End If
pApp.FileSaveAs(Name:="\\Pegasus\AllAccess\Project Management\test.mpp",
FormatID:="MSProject.MPP")
pApp.FileClose()