creator中excel如何另存为pdf

Uibot-gjh 11月前 280

creator中excel如何另存为pdf

最新回复 (4)
  • 薇~ 11月前
    2
    亲~用话鼠标键盘。,模拟人工点击Excel的菜单,另存为pdf
  • 谢老师 11月前
    3
    通过执行宏去转换为PDF
  • 谢老师 11月前
    4
    参考VBA函数
    Public Function ExcelToPDF(FilePath As String, SaveDir As String)
        '将Excel转换为PDF
        'Input:
        '       FilePath:Excel文件路径
        '       SaveDir:保存路径
        'Output:
        '      Null
        Dim Wb As Workbook
        Dim SheetObj As Object
        Dim Name As String
        Dim FileName As String, NewFilePath As String
        
        Set Wb = Workbooks.Open(FilePath)
        Set SheetObj = Wb.Sheets(1)
        
        FileName = GetFileName(FilePath)
        Name = Split(FileName, ".")(0)
        NewFilePath = SaveDir & "\" & Name & ".pdf"
        
        d = SheetObj.ExportAsFixedFormat(0, NewFilePath)
        
        Wb.Close SaveChanges:=False
    End Function
  • rainvale 11月前
    5
    可以用过python,把Excel转换到PDF文件
返回
发新帖