R
Rod Gill
Hi,
In Access when I run the following Code (with reference to Project 2003
object library selected It runs OK. Without the displayalerts Project
prompts with Append or overwrite message. Thankfully in Project 2003 at
least the default is append.
Sub test()
Dim ProjApp As MSProject.Application
On Error Resume Next
Set ProjApp = GetObject(, "MSProject.Application")
If ProjApp Is Nothing Then
Set ProjApp = CreateObject("MSProject.Application")
ProjApp.Visible = True
End If
With ProjApp
FileNew Template:=""
FileSaveAs Name:="<D:\@ProjectSystems\Temp\Project.mpd>\Project1",
FormatID:="MSProject.MPD"
FileNew Template:=""
.DisplayAlerts = False
FileSaveAs Name:="<D:\@ProjectSystems\Temp\Project.mpd>\Project2",
FormatID:="MSProject.MPD"
.DisplayAlerts = True
End With
Set ProjApp=Nothing
End Sub
--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
In Access when I run the following Code (with reference to Project 2003
object library selected It runs OK. Without the displayalerts Project
prompts with Append or overwrite message. Thankfully in Project 2003 at
least the default is append.
Sub test()
Dim ProjApp As MSProject.Application
On Error Resume Next
Set ProjApp = GetObject(, "MSProject.Application")
If ProjApp Is Nothing Then
Set ProjApp = CreateObject("MSProject.Application")
ProjApp.Visible = True
End If
With ProjApp
FileNew Template:=""
FileSaveAs Name:="<D:\@ProjectSystems\Temp\Project.mpd>\Project1",
FormatID:="MSProject.MPD"
FileNew Template:=""
.DisplayAlerts = False
FileSaveAs Name:="<D:\@ProjectSystems\Temp\Project.mpd>\Project2",
FormatID:="MSProject.MPD"
.DisplayAlerts = True
End With
Set ProjApp=Nothing
End Sub
--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/