wew.. hampura abdi baru online dei
demgan asumsi CutePDF Writter sudah terinstall di PC
pake ini taruh di modul:
Sub ExcelToPDF()
Dim PDFApps As CutePDFWriter.clsCutePDFWriter
Dim NewFileName As String, PathName As String
Dim iWsheet As Long, iTotalWsheets As Long
NewFileName = "Consolidated.pdf" 'Namafile PDF
PathName = ActiveWorkbook.Path & Application.PathSeparator
Set PDFApps = New CutePDFWriter.clsCutePDFWriter
If PDFApps.cStart("/NoProcessingAtStartup") = False Then
MsgBox "CutePDFWriter belum terinisial.", vbCritical + _
vbOKOnly, "Error!"
Exit Sub
End If
With PDFApps
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = PathName
.cOption("AutosaveFilename") = NewFileName
.cOption("AutosaveFormat") = 0
.cClearCache
End With
iTotalWsheets = Application.Sheets.Count
For iWsheet = 1 To Application.Sheets.Count
On Error Resume Next
If Not IsEmpty(Application.Sheets(iWsheet).UsedRange) Then
Application.Sheets(iWsheet).PrintOut copies:=1,
ActivePrinter:="CutePDFWriter"
Else
iTotalWsheets = iTotalWsheets - 1
End If
On Error GoTo 0
Next iWsheet
Do Until PDFApps.cCountOfPrintjobs = iTotalWsheets
DoEvents
Loop
With PDFApps
.cCombineAll
.cPrinterStop = False
End With
Do Until PDFApps.cCountOfPrintjobs = 0
DoEvents
Loop
PDFApps.cClose
Set PDFApps = Nothing
End Sub
cabut dei akh...
___________________________________________________________________________
Dapatkan alamat Email baru Anda!
Dapatkan nama yang selalu Anda inginkan sebelum diambil orang lain!
http://mail.promotions.yahoo.com/newdomains/id/