Consulting

Results 1 to 2 of 2

Thread: ExportAsFixedFormat problem not work

  1. #1
    VBAX Newbie
    Joined
    Dec 2021
    Posts
    2
    Location

    ExportAsFixedFormat problem not work

    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

  2. #2
    VBAX Newbie
    Joined
    Dec 2021
    Posts
    2
    Location
    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
    Last edited by Aussiebear; 01-13-2022 at 05:03 PM. Reason: Added code tags to supplied code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •