• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Print alındığında aynı print i pdf olarak alıp kaydetme

Katılım
5 Ağustos 2007
Mesajlar
77
Excel Vers. ve Dili
Excel 2003
Arkadaşlar,

SORU1
Excel de print alındığında alınan her print i aynı zamanda pdf ( Default Printer' dan çıktı aldıktan sonra, "Acrobat Distiller" Default Printer olarak seçilecek ) olarak alan ve C:\Fax dosyasına print alınan sayfadaki örneğin C5 & " " & G7 hücrelerin birleşimini dosya adı olarak kabul eden ( yani dosya adı ; C5 & " " & G7.pdf olacak ) bir macro yazılabilir mi?

Amacım müşterilere gönderilen faxların tamamının digital ortamda yedeğinin olması.

Not : UserForm üzerinde ya da sayfada herhangibir print butonu olmayacak. Kullanıcı normal olarak excel menüsündeki print işlemlerini gerçekleştirdiği sırada bu macro çalışsın istiyorum. ( mümkünse )

SORU2
User form üzerinde print butonu olsun ama excel menüsündeki print kullanılamaz olsun. Yani kullanıcı userformdaki print butonunu kullanmak zorunda olsun. ( olabilir mi?, olursa nasıl? )

SORU3
nasıl bir sheet, macro ile print alınamaz hale getirilir? Yani kullanıcı sheeti görsün ama yazdıramasın.

Yardımlarınız için şimdiden çok teşekkür ederim.

Saygılarımla.
 
Son düzenleme:
Arkadaşlar,

Daha önce bunu yapmış olan varsa paylaşımlarınızı bekliyorum.

Saygılarımla.
 
Arkadaşlar,

Beklemeye devam ediyorum.

Saygılarımla.

arkadaşım excelden pdf dosyası sadece converter programı ile mümkündür.Yani makinanda kurulu exceli pdf ye dönüştürecek bir program olması lazım.bu olursa bilemiyorum ama kodla olur belki.
 
Bilenler ve paylaşanlar için konu ile alakalı olduğunu düşündüğüm şu soruyu da ayrıca sormak isterim;

sorumu ilk mesajıma taşıdım.

Saygılarımla.
 
Son düzenleme:
Cevabı bir yerde buldum. Ama deneyemedim. Çünkü Acrobat Distiller im yok.
Ayrıca kodlama doğru mu bilmiyorum. Bilenler hiç değilse bunun üzerinden yorum yaparlarsa sevinirim.

Saygılarımla.

JabbaTheNut (Programmer) 27 Nov 02 13:38
I have used the following VB code to print an Excel range to an Adobe Acrobat .PDF file. The steps to accomplish this are as follows:

1. Print the range to a postscript file using Acrobat Distiller
2. Convert postscript file to .PDF using Acrobat Distiller API.

Make sure that you uncheck the "Do not send fonts to Distiller" option in the Distiller properties. You do this by entering the Distiller properties>>General Tab>>Printing Preferences>>Adobe PDF Settings and uncheck the "Do not send fonts to Distiller" option. You will get an error if you don't do this.

In the Excel Visual Basic Editor, make sure you include a reference to Acrobat Distiller.

Here is the code....

*********************************************
Private Sub CommandButton1_Click()

' Define the postscript and .pdf file names.
Dim PSFileName as String
Dim PDFFileName as String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"

' Print the Excel range to the postscript file
Dim MySheet As WorkSheet
Set MySheet = ActiveSheet
MySheet.Range("myRange").PrintOut copies:=1, preview:=False, ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True, prttofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

End Sub

And that is all there is to it! I hope this tip is helpful to some of you.
Game Over, Man!
 
Bu da başka bi yerden;

Application.ActivePrinter = "Microsoft Office Document Image Writer em Ne00:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, _
ActivePrinter:="Microsoft Office Document Image Writer em Ne00:", _
Collate:=True, _
PrintToFile:=True, _
PrToFileName:="C:\Documents and Settings\Albino\Os meus documentos\PcSetup\Extemporânea" & Format(Now, "dd-mmm-yy h-mm-ss") & ".mdi"
 
Bu da daha başka:


Print a Single Worksheet to a PDF File:


Option Explicit

Sub PrintToPDF_Early()
'Author : Ken Puls (www.excelguru.ca)
'Macro Purpose: Print to PDF file using PDFCreator
' (Download from http://sourceforge.net/projects/pdfcreator/)
' Designed for early bind, set reference to PDFCreator

Dim pdfjob As PDFCreator.clsPDFCreator
Dim sPDFName As String
Dim sPDFPath As String

'/// Change the output file name here! ///
sPDFName = "testPDF.pdf"
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator

'Check if worksheet is empty and exit if so
If IsEmpty(ActiveSheet.UsedRange) Then Exit Sub

Set pdfjob = New PDFCreator.clsPDFCreator

With pdfjob
If .cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator.", vbCritical + _
vbOKOnly, "PrtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With

'Print the document to PDF
ActiveSheet.PrintOut copies:=1, ActivePrinter:="PDFCreator"

'Wait until the print job has entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False

'Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
pdfjob.cClose
Set pdfjob = Nothing
End Sub

Print Multiple Worksheets to Multiple PDF Files:


Option Explicit

Sub PrintToPDF_MultiSheet_Early()
'Author : Ken Puls (www.excelguru.ca)
'Macro Purpose: Print to PDF file using PDFCreator
' (Download from http://sourceforge.net/projects/pdfcreator/)
' Designed for early bind, set reference to PDFCreator

Dim pdfjob As PDFCreator.clsPDFCreator
Dim sPDFName As String
Dim sPDFPath As String
Dim lSheet As Long

Set pdfjob = New PDFCreator.clsPDFCreator
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator

If pdfjob.cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator.", vbCritical + _
vbOKOnly, "PrtPDFCreator"
Exit Sub
End If

For lSheet = 1 To ActiveWorkbook.Sheets.Count
'Check if worksheet is empty and skip if so
If Not IsEmpty(ActiveSheet.UsedRange) Then
With pdfjob
'/// Change the output file name here! ///
sPDFName = "testPDF" & Sheets(lSheet).Name & ".pdf"
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With

'Print the document to PDF
Worksheets(lSheet).PrintOut copies:=1, ActivePrinter:="PDFCreator"

'Wait until the print job has entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False

'Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
End If
Next lSheet
pdfjob.cClose
Set pdfjob = Nothing
End Sub

Print Multiple Worksheets to a Single PDF File:


Option Explicit

Sub PrintToPDF_MultiSheetToOne_Early()
'Author : Ken Puls (www.excelguru.ca)
'Macro Purpose: Print to PDF file using PDFCreator
' (Download from http://sourceforge.net/projects/pdfcreator/)
' Designed for early bind, set reference to PDFCreator

Dim pdfjob As PDFCreator.clsPDFCreator
Dim sPDFName As String
Dim sPDFPath As String
Dim lSheet As Long
Dim lTtlSheets As Long

'/// Change the output file name here! ///
sPDFName = "Consolidated.pdf"
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator
Set pdfjob = New PDFCreator.clsPDFCreator

'Make sure the PDF printer can start
If pdfjob.cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator.", vbCritical + _
vbOKOnly, "Error!"
Exit Sub
End If

'Set all defaults
With pdfjob
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With

'Print the document to PDF
lTtlSheets = Application.Sheets.Count
For lSheet = 1 To Application.Sheets.Count
On Error Resume Next 'To deal with chart sheets
If Not IsEmpty(Application.Sheets(lSheet).UsedRange) Then
Application.Sheets(lSheet).PrintOut copies:=1, ActivePrinter:="PDFCreator"
Else
lTtlSheets = lTtlSheets - 1
End If
On Error GoTo 0
Next lSheet

'Wait until all print jobs have entered the print queue
Do Until pdfjob.cCountOfPrintjobs = lTtlSheets
DoEvents
Loop

'Combine all PDFs into a single file and stop the printer
With pdfjob
.cCombineAll
.cPrinterStop = False
End With

'Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
pdfjob.cClose
Set pdfjob = Nothing
End Sub
 
Bu da böylesi;

ActuaryAtLarge (Programmer) 20 Feb 05 20:37
Dear Jabba,
I'm using your really great piece of code. Like so many others, I spent countless hours testing, then surfing, then finally finding your solution. I am having a slight problem still though.

1) I've uncheched the box in my Distiller settings to not send fonts.
2) I'm still getting the related error message.
3) Attached is my/your code:

Private Sub tektip1()
' *******
' From "JabbaThe Hut"

' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveWorkbook.PrintOut from:=11, To:=17, copies:=1, preview:=False, ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

End Sub
 
Arkadaşlar,

SORU1
Excel de print alındığında alınan her print i aynı zamanda pdf ( Default Printer' dan çıktı aldıktan sonra, "Acrobat Distiller" Default Printer olarak seçilecek ) olarak alan ve C:\Fax dosyasına print alınan sayfadaki örneğin C5 & " " & G7 hücrelerin birleşimini dosya adı olarak kabul eden ( yani dosya adı ; C5 & " " & G7.pdf olacak ) bir macro yazılabilir mi?

Amacım müşterilere gönderilen faxların tamamının digital ortamda yedeğinin olması.

Not : UserForm üzerinde ya da sayfada herhangibir print butonu olmayacak. Kullanıcı normal olarak excel menüsündeki print işlemlerini gerçekleştirdiği sırada bu macro çalışsın istiyorum. ( mümkünse )

SORU2
User form üzerinde print butonu olsun ama excel menüsündeki print kullanılamaz olsun. Yani kullanıcı userformdaki print butonunu kullanmak zorunda olsun. ( olabilir mi?, olursa nasıl? )

SORU3
nasıl bir sheet, macro ile print alınamaz hale getirilir? Yani kullanıcı sheeti görsün ama yazdıramasın.

Yardımlarınız için şimdiden çok teşekkür ederim.

Saygılarımla.

Bu sorunun cevabını arayan daha önce olmadı mı?
 
Uzman Arkadaşlar,

Müsait olduğunuzda ilgilenirseniz sevinirim.

Saygılarımla.
 
Uzmanların sevmediği bir cümle ama,

"KİMSE YOK MU YARDIM EDECEK"

biraz sabredeyim dedim ama sabır da kalmadı. olumlu ya da olumsuz fikri olan yok mu?

niye kimse cevap yazmıyor?

bu konu bence birçok kişinin işine yarayacak birşey.
cevap vermemeniz hiç düşünme gereği bile duymadığınız hissini uyandırıyor.
umarım yanlış düşünüyorumdur.

Saygılarımla.
 
Arkadaşlar,

Bu konuda fikri olanların paylaşımını rica ediyorum.

Saygılarımla.
 
Arkadaşlar,

Bu konuda fikri olanların paylaşımını rica ediyorum.

Saygılarımla.

bendede exceli pdf çeviren program var. (Sonic PDF creator) ama bende kod olayını bilmediğim için direkt olarak programı kullanıyorum. eğer sizin sorunuz cevaplanırsa herkes için faydalı olur düşüncesindeyim.
 
dopdf programını ücretsiz edinebilirsiniz dopdf programı bir yazıcı gibi sisteminize kurulur
fakat şimdiki sorun bir hamlede 2 ayrı yazıcıya yazdırmak ve isim vermek
 
Paylaşım için teşekkürler.
 
Geri
Üst