Exporting to MS Project now need to Save

new_2_prog

Registered User.
Local time
Today, 15:05
Joined
Aug 4, 2008
Messages
58
I have exported data out to MS Project via VBA in Access into a Project template now I would like to add code to Save the file as whatever I designate. Current code:

Public Sub exportMSProjectTasks()
Dim jobNum, Fn As String
Dim JobID As Long
Dim app As Object
Dim varFileNames As Variant

Set app = Nothing

JobID = [Forms]![Jobs]![JobID]
jobNum = DLookup("[Job#]", "Jobs", "[JobID] =" & JobID)

Fn = "C:\Timeline\tempExport.xls"

DoCmd.OpenQuery "ProjExport_DELETE"
DoCmd.OpenQuery "ProjExport_ADD"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "ProjExport", Fn, Yes

Set app = CreateObject("MSProject.Application")
app.alerts False

varFileNames = "C:\Timeline\Temp.mpt"
app.fileopen Name:=varFileNames, ReadOnly:=False
app.fileopen Name:=Fn, ReadOnly:=False, Map:="Workload_Temp2"

Call deleteTempFile

app.Visible = True
End Sub

I have tried:
app.FullName "NEWFILE"
app.Name "NEWFILE"
app.Save "NEWFILE"
app.SaveAs "NEWFILE"
these either don't work or don't apply.

Thanks!
 

Users who are viewing this thread

Back
Top Bottom