Katip kardeş;
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..