Last active
November 14, 2020 17:23
-
-
Save shebpamm/f466576acbd44903af9e25d78e473147 to your computer and use it in GitHub Desktop.
Tippimakro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub pdfTest() | |
Dim sFile As Variant | |
Dim strPath As String | |
Dim strPathFile As String | |
Dim strSaveBasePath As String | |
Dim strCurrentMonth As String | |
Dim targetTime As Variant | |
targetTime = Now() | |
'targetTime = CDate("2021-01-01 03:00:00") | |
If Hour(targetTime) <= 5 Then | |
targetTime = DateAdd("d", -1, targetTime) | |
End If | |
Debug.Print targetTime | |
strSaveBasePath = "\\office\tiedostot\Veikkaus_tyoryhmat\Pelisalien kirjanpito\Feel Vegas Helsinki Tripla\Tipit" | |
strCurrentMonth = WorksheetFunction.Proper(WorksheetFunction.Text(targetTime, "[$-040B]mmmm")) | |
strPath = strSaveBasePath & "\" & strCurrentMonth & " " & Format(targetTime, "yyyy") | |
strPathFile = strPath & "\" & Format(targetTime, "yyyy mm dd") & " Tipit" | |
sFile = Application.GetSaveAsFilename _ | |
(InitialFileName:=strPathFile, _ | |
FileFilter:="PDF Files (*.pdf), *.pdf", _ | |
Title:="Tarkista sijainti") | |
If sFile <> "False" Then | |
ActiveWorkbook.ExportAsFixedFormat _ | |
Type:=xlTypePDF, _ | |
Filename:=sFile, _ | |
Quality:=xlQualityStandard, _ | |
IncludeDocProperties:=True, _ | |
IgnorePrintAreas:=False, _ | |
OpenAfterPublish:=True | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment