PDA

View Full Version : [SOLVED:] ExportAsFixedFormat problem not work



Lac37
12-29-2021, 04:11 AM
Hi, i want to use this command to export my gantt to pdf.

The command does not work, did I get the syntax wrong?

MSProject.Application.ActiveProject.ExportAsFixedFormat FileName:="C:\Users\User1\Downloads\Gantt1.pdf", FileType:=pjPDF, IncludeDocumentProperties:=True, IncludeDocumentMarkup:=False, ArchiveFormat:=False, FromDate:="19/12/21 23:00", ToDate:="13/03/22 23:00"





Thank you

Lac37

Lac37
01-13-2022, 06:32 AM
Hi ,
I solved it with these lines code.


Sub Macro1()
Dim Sd As String
Dim Fd As String
Sd = "01/01/22 09:00:00"
Fd = "12/01/22 09:00:00"
Application.DocumentExport FileName:="C:\Users\Max\Documents\Gantt1.pdf", FileType:=pjPDF, IncludeDocumentProperties:=True, IncludeDocumentMarkup:=False, ArchiveFormat:=False, FromDate:=Sd, Todate:=Fd
End Sub

Thanks

Lac37