ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] VBA¿é¥XPDF©ó¯S©w¦¸¼Æ«áµo¥Í°ÝÃD

[µo°Ý] VBA¿é¥XPDF©ó¯S©w¦¸¼Æ«áµo¥Í°ÝÃD

¥»©«³Ì«á¥Ñ ntpuvnm ©ó 2019-3-19 21:41 ½s¿è

³Ìªñ¦b¶]¤½¥q¸ê®Æ²£»s¹Ïªí¿é¥X¡A¦ýµL½×¥Î¡uExportAsFixedFormat¡v©Î¡uPrintout¡vªº¤è¦¡³B²z¡A¤j¬ù165µ§¥ª¥k´N·|²§±`¡A¤U¤è¦³´ú¸Õ®Éªº¿ý¼v¬ö¿ý

1.¤£²£¥XPDF´ú¸Õ¥i¥H¶]§¹¥þ³¡¸ê®Æ
2019-03-17VBA´ú¸Õ¬ö¿ý
https://youtu.be/4NK0B0OHt9U


2.²£¥XPDF
(1)¥HExportAsFixedFormatªº¤è¦¡²£¥Xªº¸ê®Æ¸û¤p
2019-03-17VBA´ú¸Õ¬ö¿ýExportAsFixedFormat
https://youtu.be/ZtYduSyLqnQ


(2)¥Hprintout¤è¦¡²£¥Xªº¸ê®Æ¤j¬ù¬°ExportAsFixedFormat¤èªkªº2­¿¤j¤p
2019-03-17VBA´ú¸Õ¬ö¿ýprint
https://youtu.be/219px5hiU2k


¨t²Î¸ê·½¤£¨¬¡AµLªk§¹¾ãÅã¥Ü¡C
PDF¿é¥X¿ù»~µe­±.png

¦ýµL½×¥H¦óºØ¤è¦¡¡A¤j¬ù°õ¦æ165µ§«á´N·|²§±`¡AÆ[¹îºI¹Ï«á
Ū¨ú¶q¤j¤p Printout(178,665) > ExportAsFixedFormat(151,766) > ¤£²£¥XPDF(31,057)
¼g¤J¶q¤j¤p ExportAsFixedFormat(655,688) > Printout(17,874) > ¤£²£¥XPDF(5,786)
¨ä¥LI/O¤j¤p Printout(1,190,267) > ExportAsFixedFormat(948,638) > ¤£²£¥XPDF(104,833)
°O¾ÐÅé¥Î¶q ExportAsFixedFormat(231,952K) > Printout(229,096K) > ¤£²£¥XPDF(172,692K)
²q·QÀ³¸Ó¬O°O¾ÐÅé¨Ï¥Î¶qªº°ÝÃD¡A¦ý¬O¤£²£¥XPDF¤U°õ¦æ¨ì499µ§ªº°O¾ÐÅé¶q«o¤£·|µo¥Í¡u¨t²Î¸ê·½¤£¨¬¡AµLªk§¹¾ãÅã¥Ü¡C¡vªº°ÝÃD¡A½Ð°Ý¥i¯à¬O­þ­ÓÀô¸`¥X¤F°ÝÃD©O??

¤U¤è¬°ÂàÀɮɥD­n·|¥Î¨ìªºµ{¦¡½X

Sub export()
    Dim FileName As String
    Dim myFolder$
    Dim MyFile As Object
    Dim i As Integer, filemsg As Integer

    myFolder = "D:\"

    For i = 1 To 499

    '¼È°±10¬í
    If i Mod 50 = 0 Then
    ThisWorkbook.save
    End If

    Application.StatusBar = "¥Ø«e¶i«×" & i

        myfilepath = myFolder & FileName & ".pdf"
        ¿é¥X.ExportAsFixedFormat Type:=xlTypePDF, FileName:=myfilepath,Quality:=xlQualityStandard, IncludeDocProperties:=True,IgnorePrintAreas:=False, OpenAfterPublish:=False  'ExportAsFixedFormat¤èªk
        '¿é¥X.PrintOut ActivePrinter:="Microsoft Print to PDF", Copies:=1,Collate:=True, IgnorePrintAreas:=False, PrToFilename:=myfilepath  'printout¤èªk
        Application.Wait Now() + TimeValue("00:00:01")

        Set MyFile = CreateObject("Scripting.FileSystemObject") 'ÀË´úÀɮפj¤p
        Application.Wait Now() + TimeValue("00:00:01")

        With MyFile.Getfile(myfilepath)
        filemsg = Round(.Size / 1024)

        '§PÂ_Àɮפj¤p
        If filemsg < 50 Then
            filelog = "Àɮ׿ù»~¡A±j¨î¸õ¥X°j°é"
            MsgBox (filelog)
            Exit For
        End If
        Set MyFile = Nothing

        End With
    Next
End Sub

¦b¨S³]©w³o¬q¥N½X´N¦³³o°ÝÃD¤F,¬O³]¤F³o¬q²×¤î°õ¦æ¤~¹ï¸Üµøµ¡Åã¥Ü°O¾ÐÅé°ÝÃD,§_«h­ì¥ýªºª¬ªp¬Oexcelµe­±­áµ²¦í³£µL¤ÏÀ³,³s°ÝÃD¦b­þ³£¤£²M·¡

¦^´_ 2# jcchiang

TOP

¦^´_ 1# ntpuvnm

If filemsg < 50 Then
            filelog = "Àɮ׿ù»~¡A±j¨î¸õ¥X°j°é"
            MsgBox (filelog)
            Exit For
        End If

¥i¯à¬O³o¤@¬qÀˬdÀɮפj¤p,§PÂ_ÀÉ®×<50´N¸õ¥Xµ{¦¡,¥i¸ÕµÛ§ï¤p¸Õ¸Õ

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD