I am trying to create a Microsoft Project document from a template, input two pieces of data gathered from an Excel spreadsheet, name the document with the same two pieces of data, save the MS Project file and exit the application.
I have no idea how to open the MS Project application but based on limited knowledge of inputting data into a Word Document, I would imagine the code to look something like this: (Please assume that the data for “Site” and “Project” is correctly gathered and defined earlier in the code)
I have no idea how to open the MS Project application but based on limited knowledge of inputting data into a Word Document, I would imagine the code to look something like this: (Please assume that the data for “Site” and “Project” is correctly gathered and defined earlier in the code)
Code:
Dim appProj As MSProject.Application
Dim aProg As MSProject.Document
Set appProj = CreateObject("MSProject.Application")
Set aProj = appProj.Documents.Open(Filename:="C: \MS Project.mpt")
aProj.Application.Visible = True
FilePageSetupHeader Alignment:=pjRight, Text:=Site & " - " & Project
FileSaveAs Name:="C:\" & Site & " - " & Project & ".mpp", FormatID:="MSProject.MPP"
aProj.Close
Set aProj = Nothing
appProj.Quit
Set appProj = Nothing