Excel Save as pdf, Script in Description
Автор: Cells and Sheets
Загружено: 2025-03-19
Просмотров: 369
Описание:
Copy & Paste below code in the Module
Sub SaveAsPDF()
Dim ws As Worksheet
Dim filePath As String
Dim fileName As String
Dim PDFPath As String
' Get the file path of the Excel workbook
filePath = ThisWorkbook.Path
' Get the workbook name without extension
fileName = Left(ThisWorkbook.Name, InStrRev(ThisWorkbook.Name, ".") - 1)
' Append "sizes" to the filename
fileName = fileName & "_sizes"
' Create the full PDF path
PDFPath = filePath & "\" & fileName & ".pdf"
' Export as PDF
ThisWorkbook.ExportAsFixedFormat Type:=xlTypePDF, fileName:=PDFPath, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "File saved as PDF: " & PDFPath
End Sub
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: