Este exemplo mostra como usar o método ExportAsFixedFormat para exportar uma série de dados em uma planilha do Microsoft Excel para o formato PDF ou XPS.
Sub TestExportAsFixedFormat()' For information on the final parameter, see this page:Dim rng As RangeSet rng = Range("A1:E10")SetupRangeData rngDim fileName As String' Change this file name to meet your own needs:Let fileName = "C:\Temp\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:=TrueEnd SubSub SetupRangeData(rng As Range)Let rng.Formula = "=RANDBETWEEN(1, 100)"End Sub
Anexos:
Nenhum comentário:
Postar um comentário