Convert Excel to PDF (VBA Automation)

Опубликовано: 04 Июль 2026
на канале: Excel Yoga
955
9

In this video you will learn how to convert excel to PDF using VBA



Code:
Sub Export_PDF()
Dim File_path As String
Dim i As Integer
File_path = ThisWorkbook.Path & "\"
For i = 1 To Sheets.Count
Worksheets(i).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=File_path & Worksheets(i).Name & ".pdf", openafterpublish:=True
Next i
End Sub