Since I added the time format the code stopped working, is there any way to include the time in the file name?
Code:
Sub SaveAsPDF()
Dim FilePath As String
Select Case MachineName
Case "A4", "A8.1", "A8.2", "A8.3", "A12.1", "A12.2", "A12.3", "A20.1", "A20.2"
FilePath = Environ("userprofile") & "\Documents\Projeto\" & MachineName & "\"
Sheets("Final").Range("A1:AO69").ExportAsFixedFormat Type:=xlTypePDF, filename:=FilePath & MachineName & " _ " & Format(Now(), "dd.mm.yyyy") & " _ " & Format(Now(), "hh:mm") & " _ " & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Select
End Sub
Code:
Sub SaveAsPDF()
Dim FilePath As String
Select Case MachineName
Case "A4", "A8.1", "A8.2", "A8.3", "A12.1", "A12.2", "A12.3", "A20.1", "A20.2"
FilePath = Environ("userprofile") & "\Documents\Projeto\" & MachineName & "\"
Sheets("Final").Range("A1:AO69").ExportAsFixedFormat Type:=xlTypePDF, filename:=FilePath & MachineName & " _ " & Format(Now(), "dd.mm.yyyy") & " _ " & Format(Now(), "hh:mm") & " _ " & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Select
End Sub