Excel Vba Forum - Excelce.Net

SORU ve CEVAPLAR (Yazılabilir) => Microsoft Excel, Vba, Makro, Formül vb. Soruları => Konuyu başlatan: katip16487 - 18 Nisan 2012, 21:08:11

Başlık: Excel Sayfasını PDF'ye Aktarma
Gönderen: katip16487 - 18 Nisan 2012, 21:08:11
Sub wordeaktar()
Set word = CreateObject("Word.Application")
word.Documents.Add
word.Visible = True
[AKTARILACAK SAYFA ADI!A1:G30].Copy
word.Selection.PasteExcelTable False, False, False
Application.CutCopyMode = False
End Sub

Makrosunu kullanarak EXCELL sayfasını WORD'e aktarabiliyorum...

Peki aynı şekildeki makro ile EXCELL sayfasını PDF olarak aktarma/kaydetme imkanım yok mudur?
Başlık: Ynt: Excel Sayfasını PDF'ye Aktarma
Gönderen: Bülent Öztürk - 19 Nisan 2012, 14:53:55
Bilgisayarınıza PDFCreator kurup, belgelerinizi Pdf olarak kaydedebilirsiniz.

Başlık: Ynt: Excel Sayfasını PDF'ye Aktarma
Gönderen: denemeler01 - 21 Nisan 2012, 19:27:37
Katip kardeş;
Kod: [Seç]
Sub TestExportAsFixedFormat()
  ' For information on the final parameter, see this page:
  ' http://msdn.microsoft.com/en-us/library/aa338206.aspx
 
  Dim rng As Range
  Set rng = Range("A1:E10")
  SetupRangeData rng
 
  Dim fileName As String
  ' Change this file name to meet your own needs:
  fileName = "C:\Users\mutluhan\Desktop\Export.pdf"
 
  ' Many of these properties are optional, and are included
  ' here only to demonstrate how you might use them. The
  ' Type parameter can be one of xlTypePDF and xlTypeXLS;
  ' the Quality parameter can be one of xlQualityStandard and
  ' xlQualityMinimum. Setting the OpenAfterPublish property
  ' to True will fail if you don't have a default viewer
  ' installed and configured.
 
  rng.ExportAsFixedFormat Type:=xlTypePDF, _
   fileName:=fileName, Quality:=xlQualityStandard, _
   IncludeDocProperties:=True, IgnorePrintAreas:=True, _
   From:=1, To:=1, OpenAfterPublish:=True
End Sub

Sub SetupRangeData(rng As Range)
  rng.Formula = "=RANDBETWEEN(1, 100)"
End Sub
Bunu bir incele, kendine adapte edersin....
Ayrıca bu kod "Office 2010 101 Code Samples" bunun içinden alınma. Bu ismi google'da arat, microsoft'un sitesinde diğer örneklere de ulaşırsın.
Kolay gelsin..